This question already has answers here:
REGEX - Allow Numbers and . - /
(7 answers)
Closed 2 years ago.
Currently I have a textbox that accepts only Alphabet, hyphens(-), space and apostrophes('). Now I would like to add numeric values as well to it. Currently I am using the Regex as below:
/^[a-zA-ZÀ-ÖØ-öø-ÿ' -]+$/
How would I achieve adding numerics as well to the above?
To allow numbers, simply add 0-9 in your regex, like so:
/^[0-9a-zA-ZÀ-ÖØ-öø-ÿ' -]+$/
Related
This question already has answers here:
How to parse a URL?
(6 answers)
Closed 8 months ago.
This is the format for which I want to generate regex https://<any>.blob.core.windows.net/<any>?<any> where any allowed any character(including special char also). I mean all where the other part is static.
Can you help to generate regex for above pattern?
Thanks
This will match anything in the places where you put <any>.
https:\/\/.*\.blob\.core\.windows\.net\/.*\?.*
/^https:\/\/.+\.blob\.core\.windows\.net\/.+\?.+$/gm
<any> - any character (except for line terminators) between one and unlimited times. Can't be empty
This question already has answers here:
numbers not allowed (0-9) - Regex Expression in javascript
(6 answers)
Closed 2 years ago.
I am trying to create a react(javascript) form, In that one field should allow all values (Uppercase letters, Lowercase letters and special characters) but not numbers.
Is there any regex or any other solution?
Thanks in advance.
You can simply check that a string DOESN'T contain numbers using regex \d which matches all numbers:
!(/\d/.test(string))
This question already has answers here:
Reference - What does this regex mean?
(1 answer)
Using explicitly numbered repetition instead of question mark, star and plus
(4 answers)
Match exact string
(3 answers)
Closed 4 years ago.
I need to have a Regex for matching a single (or greater) non- blank space character (would allow all special characters such as !,' etc...). Would
var filter = /\S+/;
be sufficient? This seems to work for 1 or greater.
Would:
var filter = /\S+/{3,};
be sufficient for 3 or more of the non-same characters (like "def", "a!c", "dA!!f", but not "some bird"?
This question already has answers here:
I want to ignore square brackets when using javascript regex [duplicate]
(4 answers)
Closed 8 years ago.
I have a very simple form with this regex pattern set on my first/last name fields ng-pattern="/^[a-zA-z]{2,30}$/" and both fields accept this value as being valid e.g. Tester\^*&^%. The first/last name should only accept alpha character a-zA-Z with a minimum of 2 characters and a max of 30.
Here is the wrong thing.
^[a-zA-z]{2,30}$
^
|
It would match \^ symbols because these symbols are comes under the range from A to z.
Modified regex.
^[a-zA-Z]{2,30}$
This question already has answers here:
Matching numbers with regular expressions — only digits and commas
(10 answers)
Closed 9 years ago.
I want to generate a regular expression for the following situation.
a input box should accept numbers and dot in the following format XXX.XX.
It accepts also numbers as XX
It accepts also numbers as X
It accepts also numbers XX.XX
It accepts also numbers X.XX
I did like this: /[0-9]{3}\.[0-9]{2}$/, but it satisfied only point number 1.
Try this:
^[0-9]{1,3}(\.[0-9]{1,2})?$