Regex validation with address house number mandatory [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
This is my regex for address validation right now
^[a-z-A-Z\ \d\#\-\.\`\\\/\'\(\)]+$
Now I need to make sure the address has mandatory house number
I changed to:
^[\d*a-z-A-Z\ \d\#\-\.\`\\\/\'\(\)]+$
but it's not working.
I need to check against this address:
8952 West Auburn St

If you want a number, followed by any of these [a-z-A-Z\ \d#-.\/'()], this is what you are looking for
^\d{1}[a-z-A-Z\ \d#-.\/'()]+$
It mean, it starts with a digit, with a length of at least 1, then matches anything in the square brackets, as many characters if you want
You can see it in action (and test alternatives) here:
https://regex101.com/r/tehNbZ/1

Related

persian phone number regex [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am new in programming. I want to implement phone number validation using javascript in my website. I want some regex with conditions below:
a digit with length of 11
it should start with 09
no any string or space in the input is accepted
e.g.
"09131234455" // is accepted
"091 05488963" // not accepted
thanks anyone can help!!
Try: ^09\d{9}$ (first '09', then 9 digits, all this surrounded with
"start of string" and "end of string" anchors).

How to choose between two words using JS regex [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a sentence example: I am just one man I', trying to capture am just on with the following regex, but it also captures I which is not what I need.
(?=I).*(?= man)
The result is: I am just one
I don't want extra capturing groups, only the full match which should be am just one.
change the first positive lookahead to a negative (?!I). This won't capture I
(?!I).*(?= one)
By saying look and match anything except I
(?=[^I ]).*(?= man)

Regular Expression character set only [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I tried this : [fl]ady?[ing] ?[rb]ug!?
I know [fl]ad[y]?(ing)? ?[br]ug!? is an answer
Can this be solved using character sets only? Must match both.
ladybug
fading rug!
I believe this should work for you
[fl]ad(y|ing)\s?[br]ug?
Check out http://www.regexpal.com/
Using character sets only? So, it doesn't matter what other letter combinations it matches as well? Mmm. Then
[fl]ad[giny]+[\sbrug!]+
would do. See: https://regex101.com/r/FJWJyM/1

Regex pattern matching specific word [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have a text input on my html page. When a user tries to add a new watch I want it to start with WATCH_XXXX (X's are whatever the user inputs). It has to start with WATCH_ all caps with the underscore. I've tried a lot of different ways but I keep getting the "please match the requested format" pop-up. This was the last one I tried -> required pattern="^WATCH_[a-z]". Am I even close to getting this right?
This regex ^WATCH_[a-zA-Z]+$ should work
<form>
<input required pattern="^WATCH_[a-zA-Z]+$"/>
<input type="submit"/>
</form>
Do all characters after "WATCH_" have to be letters? If not ^WATCH_.* may work better.
Tested here: https://regex101.com/#javascript
Also a great learning tool I use for Regex: http://regexone.com/

search for the same number in the beginning and the end of a string [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to write regexp to find a string who start and ends with the same number like so :
2aldkc2 <----
4alou4 <----
edit , i forget to motion what i have tried so far :
^(\d).^([^h].*$)
but this doesn't work
Use capturing group.
^(\d).*\1$
The regex captures the first digit and match that particular line only if the last character is also the same as the one captured.
DEMO

Categories