It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I want a regular expression for using it in ASP.NET. It should be of 10 alphanumeric digits. The first 5 characters are letters, next 4 numerals and last character letter.
that should do the trick
^[a-zA-Z]{5}[0-9]{4}[a-zA-Z]$
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How would you construct a regex matching a password that must consist of 6 to 16 characters and contain at least one number or special character?
You need to define what constitutes special characters for you.
Something like this regex should work:
(?=^.*?[\d#;:'"()`~#!%$&=-])^.{6,16}$
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
and there are exactly 3 integers. No floats allowed. No characters allowed. Just integers.
The pattern for that is this: \d+\s*,\s*\d+\s*,\s*\d+
Matches three digits with any number of spaces
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Need regex for 0|1, except the letters can't repeat.
So:
101010 - valid
010101 - valid
110011 - invalid
Well, this is pretty trivial:
(?=[01])0?(?:10)*1?
1?(01)*0? // matches alternating 1s and 0s
^1?(01)*0?$ // same as above but only whole strings
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I need a regular expression which can detect 5 consecutive occurrences of any digit or character as given in below examples :
A11111C2 – INVALID
AAAAAAA21 – INVALID
12AXXXXX – INVALID
GGGG112 – VALID
You can match five consecutive characters with (.)\1\1\1\1. So .*(.)\1\1\1\1.* matches all your invalid cases.
The \1 is a backreference, so it only matches exactly what the first group (.) matched.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
How can I write a RegEx expression match the number begin with 890 or 1234 and its whole lengh is 10 if 890 or 11 if 1234
For example:
the input string : abc89093567892bcd
the result is :8909356789
the input string : abc123498912335bcd
the result is :12349891233
Using perl or sed, you could try something like:
/\d{3,11}/
\d is for digit, and {3,11} means that a digit must appear between 3 and 11 times.