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
My regex pattern for alphanumeric word is as given below :
/([A-Za-z0-9])*$/
Is "testuser" a valid input string for the above pattern?
Use character class.
So use: /^[A-Za-z0-9]+$/
And yes, testuser is a valid input for the above regex.
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 4 years ago.
Improve this question
I want to write a regex for matching *#xxx[.]gr in js.
My regex so far :
/^(([^<>()\[\]\\.,;:\s#"]+(\.[^<>()\[\]\\.,;:\s#"]+)*)|(".+"))#((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
I want : *#xxx.gr
If I understand your specs correctly this should suit you:
/^[^<>()\[\]\\.,;:\s#"]+#[^<>()\[\]\\.,;:\s#"]{3}\[\.\][^<>()\[\]\\.,;:\s#"]{2}$/g
Demo: https://regex101.com/r/kfjAG9/2
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 7 years ago.
Improve this question
I need to check string if contains >< /!a-zA-Z or some of them (Also contains space). The only thing I know is a-zA-Z i need an example in C# or Javascript.
Use a "character class".
/[>< \/!a-zA-Z]/
Note that I've escaped the forward slash, since we're using forward slashes as delimiters.
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 7 years ago.
Improve this question
I am trying to add non whitespace to my javascript. I am currently checking for letters only, but now I need to add a non whitespace code to it. This is what I have:
var regexNamePattern = /^[a-zA-Z /-]{2,30}$/;
Whitespace is \s and non-whitespace is \S.
var regexNamePattern = /^\S{2,30}$/;
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....