I have written a regular expression to match some tags that look like this:  @("hello, world" bold italic font-size="15")   I want the regular expression to match these strings: ['hello, world', 'bold', 'italic'...
I'm very puzzled about why this is happening, and hoping someone can explain the mechanics of what is happening in the regex engine.  Whilst working on codewars exercise "Did you mean...?" in Javascript, I was trying to calculate how many...
I'm trying to solve a string matching problem with regexes. I need to match URLs of this form:  http://soundcloud.com/okapi23/dont-turn-your-back/   And I need to "reject" URL of this form:  http://soundcloud.com/okapi23/sets/happily-reve...
I'd like to match a three-part string. The first part consists of one or more a characters, the second part consists of one or more b characters, and the third part consists either of zero or more c characters or zero or more C characters, but no...
I am trying to grab a digit (5) followed by a possible - or  (space) proceeding a sequence of 3 digits, followed finally by a single digit. If the first group doesn't match at all, then only return the other sequences of digits.  ^(5\-? ?)?(\d{3}...
so I have a string like this:   var a = " 'asdf'+'asdf'+'we' + 1";   I am able to select the three quotes with:  '([^']*)'   How do I select the start of the single quote(') in the string using regex? A...
I'm trying to come up with some regex which I can use to replace the last space character with a non-breaking space (control widows) within headings only inside a block of HTML.  So far I have this:  const regex = /(<h.>.+?)\s+((\S|<[^&g...
I have found examples of a Regex that will match if a string does not contain a particular word. But I am looking for something that will match if it contains a word AND not another word. Example:  I'm dealing with URL exclusi...
I'm trying to replace var tags with an attribute so they are wrapped in square brackets  data.replace(/<var .*?="">(\d+)<\/var>/ig, '[[[$1]]]');   but this will not work if there are multiple var tags. For example,   &...
Find string between two strings. I am getting only first group but there are more strings that matches regex but I don't know what I am missing. Below is my regex.  (?<="product": ")(.*?)(?=")   Input: {"...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.