This question already has an answer here:
Learning Regular Expressions [closed]
(1 answer)
Closed 5 years ago.
Can someone help for regular expression for the following (only alphanumeric upper and lower case with - after 12 characters) i need to use in in my groovy assertion.
7AYNEHFjEee4-AJiXJP2jg
assert '7AYNEHFjEee4-AJiXJP2jg' =~ /^[a-zA-Z0-9]{12}-[a-zA-Z0-9]{9}$/
Related
This question already has answers here:
Why does the order of alternatives matter in regex?
(1 answer)
Order of regular expression operator (..|.. ... ..|..)
(1 answer)
Closed 2 years ago.
Hi I am using a regex checker regex101.com to verify that my regex pattern is working. What I dont understand is why the position of my pattern
\/checkout\/index.jsp\?announceEmpty.*
does not work when it is at the end of my pattern match.
This regex DOES NOT work
\/checkout\/index.jsp.skipReprice=true|\/checkout\/index.jsp|\/checkout\/index.jsp\?announceEmpty.*
vs. this DOES work
\/checkout\/index.jsp.skipReprice=true|\/checkout\/index.jsp\?announceEmpty.*|\/checkout\/index.jsp
and these are the texts to match against
/checkout/index.jsp?skipReprice=true
/checkout/index.jsp
/checkout/index.jsp?announceEmpty=1&lastItemRemoved=Gola%20x%20
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 an answer here:
Learning Regular Expressions [closed]
(1 answer)
Closed 5 years ago.
examples
65+98912839128319823
65+8192381923819238123
65+123123
65+908
Only numbers with prefix 65+.
You should try ^65+[0-9]*. This should work
This question already has answers here:
Regex negation?
(3 answers)
Closed 7 years ago.
Regular expression - how to negate ^[A-Z]{4}[0-9]{2}$
see demo here https://regex101.com/r/bO9pH0/2
/^(?![A-Z]{4}[0-9]{2}$).*/gm
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.