About 2,930,000 results
Open links in new tab
  1. 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 …

  2. c# regex matches example - Stack Overflow

    The extra '\' is intentional. When you pass the pattern around in the C# code, the doubled '\' lets the CLR know that the '\' is part of the regex pattern, not a special character in the C# string such as '\n' or '\t' …

  3. Regular Expression to match letters, numbers and underscore in C#

    I am trying to create a regular expression pattern in C#. The pattern can only allow for: letters numbers underscores So far I am having little luck (I'm not good at RegEx). Here is what I have t...

  4. Regex for numbers only in C# - Stack Overflow

    Dec 16, 2019 · I haven't used regular expressions at all, so I'm having difficulty troubleshooting. I want the regex to match only when the contained string is all numbers; but with the two examples below it is

  5. c# - Regex Email validation - Stack Overflow

    Mar 17, 2011 · I use this @"^([\\w\\.\\-]+)@([\\w\\-]+)((\\.(\\w){2,3})+)$" regexp to validate the email ([\\w\\.\\-]+) - this is for the first-level domain (many letters and ...

  6. c# - How do I match an entire string with a regex? - Stack Overflow

    Nov 8, 2010 · The potential hiccup is that the regex could be written so that it could either match the entire string or a part of it, with the Regex.Match function returning the partial match even though a …

  7. c# - Regex: I want this AND that AND that... in any order - Stack Overflow

    The elegance of the question as asked, and of the answers which answer it directly, is their applicability not just to a simple regex search/replace within C# code, but also to a search/replace in the IDE, …

  8. c# - Regex for removing only specific special characters from string ...

    Regex for removing only specific special characters from string Asked 8 years, 10 months ago Modified 4 years ago Viewed 101k times

  9. c# - using static Regex.IsMatch vs creating an instance of Regex ...

    Jan 6, 2009 · Static Regex methods cache the parsed regular expression representation for the last 15 (by default) patterns. So if you aren't using many different patterns in your application, or your usage …

  10. How do I get the name of captured groups in a C# Regex?

    Use GetGroupNames to get the list of groups in an expression and then iterate over those, using the names as keys into the groups collection. For example,