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).
Related
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
for example
I would like to match three null in
Sat:null-5:00pm
Sun:null-null
but not a null in snullagain.
How to write such a regex in javascript?
I believe what you want is: \bnull\b
That translates to "word boundary, followed by the word null, followed by a word boundary"
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
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 would like to use regex to validate date between 1956 to 2002.
Example:
11/12/1956 - Pass
11/12/1955 - Fail
11/12/2002 - Pass
11/12/2020 - Fail
Here is what I have so far.
^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19?[5-9][0-9]|[2-9][0-9][0-9][0-2])$
Challenge is on how to validate year value more than 1956.
Any idea on how to go about this?
Thanks.
Try with this regex: ^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.]((19([6-9]\d|5[6-9]))|200[0-2])$
Demo here
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
So i want to make a regular expression to validate times between 12:00 and 22:00 but i cant get my head around making expressions and cant find any examples online that i can just swap out examples of. Can anybody help me?
You can use the following regular expression:
^((1[2-9]|2[0-1]):[0-5][0-9]|22:00)$
This is how it works:
^ and $ match start and end of string, and they are there to prevent matching also 112:009 for example (which contains 12:00).
[2-9] matches numbers between 2 and 9, and (a|b) would match either a or b.
Debuggex Demo
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 8 years ago.
Improve this question
I am stuck with a regexp to test that a string contains only:
letters lowercase or uppercase
"." (dot sign)
digits
"_" (underscore sign)
any other character except above will need to be an invalid input
1dx.tex - OK
Ted_upcD.t3 - OK
$tex._ce - FAIL(invalid char$)
Thank you !
^[\w.]+$
This should do it....