How 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 ArticleConvert DSN string in Python to kwargs
I have a simple string which describes a MySQL connection. The string is in this form:dsn = 'user=dbuser database=mydbase host=localhost'This string can contain many of the things listed in the...
View ArticleWhat kind of regular expression captures the root of a URL? [duplicate]
Consider the following examples of...
View ArticleExtract Multiple Variants and Patterns of Middle Initials within First and...
I would like preferably a Microsoft Excel REGEXEXTRACT formula or Office 365 formula (No VBA Macros) to successfully extract all variants of Middle Initials containing multiple patterns with All...
View ArticleRegex to replace 'NO-BREAK SPACE'
I am looking for a regex to replace 'NO-BREAK SPACE's from a string.There are some question on SO related to 'NO-BREAK SPACE', but none seems to point me to the right answer.So far, i tried to use...
View ArticleASP.NET MVC regex route constraint
I'm having trouble with a specific constraint I'm trying to set up on a route. My URL must look like this one: http://hostname/id-my-title-can-be-that-long where id is composed with digit only and the...
View ArticleGraylog Search with strings containing /
I have logs which contains in full_message;-EndPoint:example/example/abc-EndPoint:example/example/qfdsf-EndPoint:example/example.. and so onI am trying to write a search query to just get...
View Article