About 9,800,000 results
Open links in new tab
  1. Check whether a string matches a regex in JS - Stack Overflow

    I want to use JavaScript (I can also use jQuery) to do check whether a string matches the regex ^([a-z0-9]{5,})$, and get a true or false result. match() seems to check whether part of a string …

  2. regex - Javascript conditional regular expression if-then-else

    Javascript conditional regular expression if-then-else Asked 10 years, 2 months ago Modified 7 years, 4 months ago Viewed 40k times

  3. regex - Validate phone number with JavaScript - Stack Overflow

    As a rule of thumb — trying to validate phone numbers is doomed to failure. What with different structures in different countries and extensions, its a very difficult problem.

  4. javascript - How to test valid UUID/GUID? - Stack Overflow

    How to check if variable contains valid UUID/GUID identifier? I'm currently interested only in validating types 1 and 4, but it should not be a limitation to your answers.

  5. Javascript Regex: How to put a variable inside a regular expression ...

    flags = 'g'; return new RegExp('ReGeX' + input + 'ReGeX', flags); } of course, this is a very naive example. It assumes that input is has been properly escaped for a regular expression. If you're …

  6. regex - Validate phone number using javascript - Stack Overflow

    Mar 7, 2017 · Learn how to validate phone numbers using JavaScript and regular expressions with examples and expert insights on Stack Overflow.

  7. regex - How do you access the matched groups in a JavaScript …

    Instead, by using matchAll, you get back an iterator which you can use with the more convenient for...of, array spread, or Array.from() constructs This method yields a similar output to …

  8. regex - JavaScript regular expressions and sub-matches - Stack …

    JavaScript regular expressions and sub-matches Asked 16 years, 7 months ago Modified 6 months ago Viewed 36k times

  9. javascript - Regex to replace multiple spaces with a single space ...

    Given a string like: "The dog has a long tail, and it is RED!" What kind of jQuery or JavaScript magic can be used to keep spaces to only one space max? Goal: "The dog has a long t...

  10. javascript - Regex to check whether a string contains only numbers ...

    To my knowledge, this matches all the variations on numbers that Java and JavaScript will ever throw at you, including "-Infinity", "1e-24" and "NaN". It also matches numbers you might type, …