05jmeter regular expressions

1. must master a regular character

"^" : ^ Matches the line or the starting position of the string, sometimes matching the starting position of the entire document.
"$" : $ Matches the end of a line or string.
"\ w" : matching letters, numbers, underscores.
For example, I want to match "a2345BCD__TTz" regular: "\ w +" here "+" number of characters as a quantifier refers to duplicate.
"\ S" : matches a space.
For example, the character "ab c" Regular: "\ W \ S \ W \ S \ W" character followed by a space, if there are a plurality of spaces between characters directly to the "\ s" written "\ s +" make space repeated.
. "" : Match any character except newline.
"[ABC]" : group of characters contains characters matching elements in parentheses.
"*" : Repeated zero or more times ( greedy ) .
E.g. "aaaaaaaa" matches any string a regular:"a *" will be out to all of the characters in "A" .
"+" : Repeated one or more times ( lazy mode ) .
For example , "AAAAAAAA" string matching all a ; canonical: "a +" will get to all the characters in a character, "a +" and "a *" except that the "+" at least once and "*" may be 0 times.
"?" : Repeated zero or one.
For example "aaaaaaaa" matching string a regular : "? A" will only be matched once, and that is the result of only a single character a .
"n-{}" : Repeated n times.
For example, from"aaaaaaaa" string matching a and repeated 3 times regular: "a {3}" The result is to get 3 th a character "AAA" .
"{n, m}" : repeated n to m times.
Example, the regular "a {3,4}" will be a match repeatedly 3 times or 4 times; it is for matching characters may be three "aaa" may be four "aaaa" regularization can be matched.
"{n,}" : repeated n times or more.
And { n- ,"A {3,}" A to be repeated at least 3 times.
"*?" : Repeated any number of times, but less duplication wherever possible.
Such as "acbacb" regular "a. *? B" will take to the first "acb" could have all but taken to add the qualifier, the only match as few characters , and "acbacb" Minimum characters The result is "ACB" .
"+?" : Repeat 1 or more times, but less duplication wherever possible.
As above, but at least to repeat 1 times.
"??" : Repeat 0 times or 1 times, but less duplication wherever possible.
Such as "aaacb" regular "a.??b" will take to the last three characters "ACB" .
"{n,m times, but less repeated as possible.
The "aaaaaaaa" canonical "a {0, m}" as happened is 0 views taken so as to empty the result

 

You can use regular expressions online test  http://tool.oschina.net/regex/  verify write their own regular expression is correct

Guess you like

Origin www.cnblogs.com/wang-mengmeng/p/11222839.html