This question already has answers here:
escaping question mark in regex javascript
(4 answers)
Closed 7 years ago.
I try to create a simple regex with a question mark based on the following string:
22969152008377?_uw=2884713357351
There should be any number at the beginning, followed by ?_uw= followed by any numbers. I am not able to add question mark to the regex. Thank you for help.
Just escape the question mark like this
\d*\?_uw=\d*
Regex101
Related
This question already has answers here:
Regular expression to match a dot
(7 answers)
Closed 2 years ago.
I'm currently working with the regex to only allow users to input digits xxxx.xxx or xxxx.xx or xxxx.
I tried the below code but instead of allowing the 5 digits, it also allows 7 and 8 digits.
(^\d{5}$)|(^\d{4}.\d{2}$|^\d{4}.\d{3}$)
^[0-9]{4}.([0-9]{3}|[0-9]{2}|[0-9]{5})$
Sample output: 1223.345 or 1324.23 or 23564
Advance Thanks!
Your period needs to be escaped, or else it will be the "any character" symbol, and will allow a digit in that place. So for that part of your regex, try:
/^\d{5}$|^\d{4}\.\d{2}$|^\d{4}\.\d{3}$/;
I'm not sure what the remainder of your regex is for, but seems outside the scope of what you're asking.
This question already has an answer here:
Reference - What does this regex mean?
(1 answer)
Closed 3 years ago.
I have the following string and I want to find a proper regex for it, so I can use it in Regular Expression in Jmeter:
DocumentId_123456
The point is that every time the numbers have different length.
so basically I want everything between _ and the end of string.
Please try it, I guess it works in jmeter
DocumentId_(\d+)
Uou can check it here: [https://regex101.com/]
This question already has answers here:
How to write a regex which matches all char-sequences without 'aaa'
(2 answers)
Closed 7 years ago.
I need a regex, idealy with only [a-z] | (string) ^ . * ? that will only match strings not containing the sequence "aaa", thus "bu","aa7a"etc. are accepted and "paaaaarot","aaaac","umraaaaaa" and such are not. It's really giving me a headache, so I'd be grateful for help (with short description, so I can understand how the solution works).
You can do it with a negative lookahead -
(?!.*aaa.*)
Not sure how to do it with only the primitives you suggest.
This question already has an answer here:
Split regex to extract Strings of contiguous characters
(1 answer)
Closed 8 years ago.
I have following question need reg expert help. I have a string "11122233344456", I need put same digits into a string. For above example, it shall be "111","222","333","444","5","6".
Another example: "223334456111", it shall be "22","333","44","5","6","111".
Would some regex expert help me to find the solution?
You can use this regex:
((\d)\2*)
And grab captured group #1
RegEx Demo
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Java \ Pattern - how to write a pattern that verifies the lack of a string?
How can I match all strings without the word "authorize" in them via regular expressions? I tried *(authorize){0}* to no avail.
/^(?!.*authorize).*/
This uses a negative lookahead to ensure that the overall pattern will match only if the expression "authorize" cannot match anywhere in the input.