About 12,100 results
Open links in new tab
  1. JavaScript String match () Method - W3Schools

    In JavaScript, a regular expression text search, can be done with different methods. With a pattern as a regular expression, these are the most common methods: match() is an …

  2. String.prototype.match () - JavaScript | MDN - MDN Web Docs

    Mar 13, 2025 · The match () method of String values retrieves the result of matching this string against a regular expression.

  3. Regular expressions - JavaScript | MDN - MDN Web Docs

    Jan 24, 2025 · Regular expressions are patterns used to match character combinations in strings. In JavaScript, regular expressions are also objects. These patterns are used with the exec () …

  4. Check whether a string matches a regex in JS - Stack Overflow

    Jan 9, 2023 · Use /youregexp/.test(yourString) if you only want to know whether your string matches the regexp. Here's an example that looks for certain HTML tags so it's clear that …

  5. JavaScript Regex Match Example – How to Use JS Replace on a …

    Jan 4, 2021 · But there's an easier way – by using the .replace() method. With .replace(), all you need to do is pass it a string or regular expression you want to match as the first argument, …

  6. JavaScript Regular Expressions (RegExp) Examples

    Nov 27, 2024 · Regular Expressions in JavaScript provide robust pattern-matching capabilities that are useful for validating input, searching and replacing text, and more. Here, we will …

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

    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 …

  8. JavaScript Regex match (): Match a String Against ... - JavaScript Tutorial

    The following example illustrates how to use the match() method with a regular expression that doesn’t have a global flag. It returns an array of the first match with additional properties.

  9. JavaScript RegExp Object - W3Schools

    In JavaScript, regular expressions are often used with the two string methods: search() and replace(). The search() method uses an expression to search for a match, and returns the …

  10. regex - Regular Expression match in javascript - Stack Overflow

    Mar 28, 2012 · What will be the correct regular expression? Try it like this: Output: Your regex was in the right direction, but didn't include the colon and captured individual characters. The \w …