I want to match all strings ending in ".htm" unless it ends in "foo.htm".  I'm generally decent with regular expressions, but negative lookaheads have me stumped.  Why doesn't this work?  /(?!foo)\.htm$/i.test("/foo.htm&...
I'm reading Douglas Crockfords Javascript: The Good Parts, I just finished the regular expressions chapter. In this chapter he calls JavaScript's \b, positive lookahead (?=) and negative lookahead (?!) "not a good part"  He explains t...
I've tried to use lookahead/lookbehind in JavaScript (described at the Regular-Expressions.info) and figured out they're not supported.  What I'm trying to do actually, is to catch a dar, which isn't followed by win. So, a string darb...
I've been wrestling with this for a while and can't figure it out. I see in Regex to match string containing two names in any order that lookarounds can be used to look for words occurring in any order. I added some additional groups to the e...
I have this user price input that I want to allow 0, 1 or 2 decimal digits.    I'm using comma for decimals. I'm not using nor allowing thousand separators.   QUESTION:  I want to replace the input if the user enters a third decimal digit.  S...
I am trying to split string in 3 different parts with regex.  I can only get function parameters from string but i also want to other parts of the string  const regex = /(\(.*?\))+/g; const sampleString = 'collection.products(take:12|skip:16)'...
For the Google Prettify syntax highlighter for the Wolfram Language, I need to match all identifiers against a large list of about 7000 built-in function names to highlight them as keywords. In the past, I simply used a regex consisting of many alter...
I need to extract $x but not $$x and '$x'.   Read $$x is invalid. Please use $x. You selected '$x' value as $x.   The following Regex works for 1.  \$x(?!$)\   I used the following Alternation (|) which had obviously failed for the se...
I want a regex that matches all emojis (or most of them) but excludes certain characters (such as “|”|‘|’|…|—).  This regex does the job via negative lookahead:   /(?!\u201C|\u201D|\u2018|\u2019|\u2026|\u2014)(\u00a9|\u00ae|[\u2000-\u3300...
This question already has answers here:...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.