About 20,500,000 results
Open links in new tab
  1. Regex: ?: notation (Question mark and colon notation)

    Dec 8, 2018 · The regex compiles fine, and there are already JUnit tests that show how it works. It's just that I'm a bit confused about why the first question mark and colon are there.

  2. regex - Matching up to the first occurrence of a character with a ...

    Be aware that the first ^ in this answer gives the regex a completely different meaning: It makes the regular expression look only for matches starting from the beginning of the string.

  3. What does regular expression \\s*,\\s* do? - Stack Overflow

    59 That regex "\\s*,\\s*" means: \s* any number of whitespace characters a comma \s* any number of whitespace characters which will split on commas and consume any spaces either side

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

    Normally the dot matches any character except newlines. So if .* isn't working, set the "dot matches newlines, too" option (or use (?s).*). If you're using JavaScript, which doesn't have a "dotall" option, …

  5. regex - How to match "any character" in regular expression? - Stack ...

    Feb 24, 2023 · For reference, from regular-expressions.info/dot.html: "JavaScript and VBScript do not have an option to make the dot match line break characters. In those languages, you can use a …

  6. regex - Regular Expressions: Is there an AND operator? - Stack Overflow

    In regex in general, ^ is negation only at the beginning of a character class. Unless CMake is doing something really funky (to the point where calling their pattern matching language "regex" could be …

  7. regex - Match linebreaks - \n or \r\n? - Stack Overflow

    While writing this answer, I had to match exclusively on linebreaks instead of using the s-flag (dotall - dot matches linebreaks). The sites usually used to test regular expressions behave diffe...

  8. Regex that accepts only numbers (0-9) and NO characters

    By putting ^ at the beginning of your regex and $ at the end, you ensure that no other characters are allowed before or after your regex. For example, the regex [0-9] matches the strings "9" as well as …

  9. regex - How can I match "anything up until this sequence of characters ...

    If you're looking to capture everything up to "abc": /^(.*?)abc/ Explanation: ( ) capture the expression inside the parentheses for access using $1, $2, etc. ^ match start of line .* match anything, ? non …

  10. OR condition in Regex - Stack Overflow

    Apr 13, 2013 · Note that your regex would have worked too if it was written as \d \w|\d instead of \d|\d \w. This is because in your case, once the regex matches the first option, \d, it ceases to search for a …