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....
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 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).
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 6 years ago.
Improve this question
I want to split strings by commas and dots using javascript. For example, a string of "10,256,326.26" would turn into ["10", "256", "326", "26"] after getting split.
Which regex can I use for this?
You can use a character class containing all characters on which you want to split
var s = "10.269,69";
document.write(s.split(/[,.]/))
You can use split() with a regex:
console.log(str.split(/,|\./));
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 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.