How can I write a Regex expression like this [closed] - regex

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.

Related

Construct a Regex matching a password [closed]

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}$

Regex for the words containing at least one numeric value? [closed]

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.
As part of my assignment I have to replace words with at least one numeric with the word STOP, Is there any way of doing it using regex?
Words
a1wew
abc
1rr
sd
Output
STOP
abc
STOP
sd
I am using regex of eclipse in find.
Find:
(?=.*\d)\w+
Replace:
STOP
One possible regex is grep '.*[0-9].*'

Design a Regular expression for 10 alphanumeric digits [closed]

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]$

Regex letters can't repeat [closed]

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

Regular Expression to allow 1 Letter and 1 Number [closed]

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.
Hi I want a regular expression that will just allow ONE letter(which can be any from A-Z in upper or lower case and then ONE numeric between(1-9)
Correct values are
T5
e3
k8
Z2
Incorrect Values are
Aa1
12
aa
rr
4r
1w
Thanks.
you should explore regex before asking this question quick tutorial
by the way this regex works for you
^[a-zA-Z][1-9]$
^ for start of string
$ for end of string
you can use according to your need
try use this regex \b[a-zA-Z][1-9]\b