Regex replace group reference and Unicode escape conflict
I am working on a latin to N'ko translator.I get a warning for this type of code:text=re.sub(r'([ߊߍߋߌߐߏߎ][\u07F2]*)\u0300','\g<1>\u07EC',text,0,re.UNICODE|re.MULTILINE)SyntaxWarning: invalid...
View ArticleRegex to check for a number in the url using Twig
This wouldnt be a big problem if I had known Twig a little more.Here is my code, I am trying to check whether the url contains number in it.{% set x = req.path %}{% set matches =...
View ArticleHow to align text to the right with notepad++?
I have text like this:1;a;3;;2;abc;4;;3;abcde;5;;I want to align texts to the right with notepad++, so become like this: 1;a;3;; 2;abc;4;;3;abcde;5;;How to do this?
View Article"MongoServerError: unknown operator: $expr" when trying to use $expr in...
I have a searchQuery object with field names as keys and strings as values that I would like to use to .findMany() any document matching them in my MongoDb collection (using Node.js). However it isn't...
View ArticleHow to get domain name from URL
How can I fetch a domain name from a URL String?Examples:+----------------------+------------+| input | output |+----------------------+------------+| www.google.com | google || www.mail.yahoo.com |...
View ArticleFastest way to remove extra blank space - in VBA excel
I'm searching the fastest way to remove [multiple] blank spaces in a string, to output in a cell afterwards. There can be 1, 2 3, X space characters.*example: "hello world how are you"*My process is...
View ArticleHow can I extract the track ID from a Spotify URL using JavaScript?
I’m building a web application that accepts Spotify track URLs. I need to extract the track ID from URLs such as:https://open.spotify.com/track/6rqhFgbbKwnb9MLmUQDhG6How can I extract the track ID...
View ArticleHow to spell the “/” (slash) character inside a regular expression?
I would like to replace all / characters in a string.What is the regex for that?someString = 'I dont know the name of / in english. :/ ';anotherString = someString.replace(///g, ')');
View ArticleMeaning of JavaScript text between two slashes
What it the meaning of this text? This is neither a comment, nor HTML text.<script type="text/javascript"> /text/</script>
View ArticleGetting a specific text from a website using Regex in Shortcuts
I’m trying to create a Shortcut on iOS that uses Regex, what I’m trying to accomplish is getting the price of a product from a website but no matter what Regex commands I use don’t work. It would be...
View ArticleWhy isn't the "or" operator being escaped in the Javascript regular...
I'm trying to check if there is a value between 'mystring' and the end character (which is a pipe). But new RegExp('mystring:.+\|').test('bla')Evaluates to true, even though I am escaping the '|'...
View Articleissues with regular expression [closed]
I have a string that should be validated to be in the form of something like "Readdata.v5". What I do in my code, is I split the string based on the . (I check to make sure there is exactly one . in...
View ArticleHow to NPM search with regex?
trying to list all packages available in private registry with npm search /.* --jsonBut output is empty [].Doc says I can use RegEx.If a term starts with /, then it's interpreted as a regular...
View ArticleHaving trouble with regular expressions [closed]
I have two questions:1)function LongestWord(sen) { var word = /[^\W\d]([a-z]+)[$\W\d]/gi; var answer = word.exec(sen); return answer;}console.log(LongestWord("9hi3"));Why does this return [hi3, i] as...
View ArticleHow to write a PDO parameterized query with multiple REGEXP conditions
I am having a problem with using REGEXP in my SQL query using PDO method. When I execute the statement I get nothing from the DB. I want to be protected from SQL Injections and I am just learning it.If...
View ArticleGet Silver or Gold Rate
I'm written widget program to get price of silver or gold price from Bloomberg websitethese are parts of the script :function getPrice() { var url = new URL(); url.location =...
View ArticleHow do I return only the matching regular expression when I...
I am trying to find a pattern in files. When I get a match using Select-String I do not want the entire line, I just want the part that matched. Is there a parameter I can use to do this?For example:If...
View ArticlePHP: regular expression to remove `â` or `â€`?
I use this regular expression to remove all the punctuation marks from a string input,$pg_url = preg_replace("/\W+/", "", $pg_url); but there are some kind of symbols or special characters I can't...
View ArticleWhy does a hyphen inside a regex character class not match a hyphen in the...
I am missing something very trivial in this regular expression. would you help me figure it out.Valid Input: Tonny & 'One' 1234-5 tea be and ZRegex: /^([a-zA-Z',\s,\d,&,#,-,(,)])*$/;As per my...
View ArticleHow to write a search pattern to include a space in findstr?
I want to search all files in a certain directory for occurrences of statements such as Load frmXYZI am on Windows 7, using the findstr command. I tried: findstr /n Load.*frm *.*But this gives me...
View Article