For example
Reference name: Myref.
Regular expression: Name= "(. +?)" Value= "(. +?)".
Template: $1$$2$.
Do not use//encapsulate regular expressions.
The values of the following variables will be set.
MYREF:file.namereadme.txt.
Myref_g0:name= "File.name" value= "Readme.txt".
MYREF_g1:file.name.
MYREF_g2:readme.txt.
These variables can subsequently be referenced in the JMeter test plan, such as ${myref}, ${MYREF_G1}, and so on.
3. Key words
Regular expressions use specific characters as keywords, which have special meanings for the regular expression engine. The use of these characters in strings must be escaped (using backslashes "\") in order to treat them as primitive characters rather than as keywords for regular expressions. Here are the keywords and their meanings.
(): Combination.
[]: Character set.
{}: Duplicate.
+?: Repeat.
.: Any matching character.
\: Escape character.
| -: Selector.
^ $: The start and end of a string or line.
Note that Oro does not support \q and \e keywords.
4. Modifier (Modifier)
In theory, the modifier can be placed anywhere in the regular expression and the position being placed begins to take effect backwards. (There is a bug in Oro that the modifier cannot be placed at the end of the regular expression.) Although the modifier does not take effect here).
The single-line (? s) and MultiRow (? m) modifiers are usually placed at the beginning of the regular expression.
The Ignore (? i) modifier can be used to affect only a certain part of the regular expression, for example:
- Match ExAct case or (? i) arbitrary (?-i) case
Template matching behaves slightly differently because of the different settings for single-row and multiline modifiers. Note that there is no association between a single line and a multiline operator, and they can be specified separately.
1) Single-line mode
Single-line mode affects only the key character ".". By default, the "." Any character can be matched (except for line breaks). In single-line mode, "." Also matches the line break.
2) Multi-line mode
Multiline mode affects only the key characters "^" and "$". By default, "^" and "$" only match the beginning and end of a string. In multi-line mode, "^" and "$" match the beginning and end of each line.
Turn: detailed jmeter regular Expressions (2)