About 50 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 matches a …

  2. regex - How do you access the matched groups in a JavaScript regular ...

    Match indicates the result of running your RegEx pattern against your string like so: someString.match(regexPattern). Matched patterns indicate all matched portions of the input string, …

  3. regex - Regular Expressions- Match Anything - Stack Overflow

    If you're using JavaScript, which doesn't have a "dotall" option, try [\s\S]*. This means "match any number of characters that are either whitespace or non-whitespace" - effectively "match any string". …

  4. Return positions of a regex match () in Javascript?

    Is there a way to retrieve the (starting) character positions inside a string of the results of a regex match() in Javascript?

  5. regex - JavaScript regular expressions and sub-matches - Stack Overflow

    101 Using String 's match() function won't return captured groups if the global modifier is set, as you found out. In this case, you would want to use a RegExp object and call its exec() function. String 's …

  6. regex - Matching exact string with JavaScript - Stack Overflow

    17 If you do not use any placeholders (as the "exactly" seems to imply), how about string comparison instead? If you do use placeholders, ^ and $ match the beginning and the end of a string, respectively.

  7. Match any/all of multiple words in a string - Stack Overflow

    May 8, 2015 · String.prototype.match will run a regex against the string and find all matching hits. In this case we use alternation to allow the regex to match either word1 or word2.

  8. JavaScript - Use variable in string match - Stack Overflow

    245 Although the match function doesn't accept string literals as regex patterns, you can use the constructor of the RegExp object and pass that to the String.match function:

  9. javascript - regex.test V.S. string.match to know if a string matches a ...

    Many times I'm using the string match function to know if a string matches a regular expression.

  10. javascript - How to loop all the elements that match the regex? - Stack ...

    Here is the case: I want to find the elements which match the regex... targetText = "SomeT1extSomeT2extSomeT3extSomeT4extSomeT5extSomeT6ext" and I use the regex in ...