Qregexp is a regular expression class of QT.
Qt has two regular expressions of different classes.
The first class is metacharacters. It represents one or more constant expressions.
The first class is an escape character, which represents a special character.
1. metacharacters
. Match any single character. For example, 1.3 may be 1. Followed by any character, followed by 3
^ Match the first character string. For example, ^ 12 may be 123, but not 312.
$ Matches the end of a string. For example, 12 $ can be 312, and cannot be 123
[] Match any character entered in brackets. [123] can be 1, 2, or 3
* Match any number of leading characters. For example, 1*2 can be any number of 1 (not even), followed by 2
+ Match at least one leading character. For example, 1 + 2 must be one or more 1, followed by a 2
? Matches a leading character or is empty. For example, 1? 2 can be 1 or 12
Ii. Unified Configuration Mode
Qregexp: setpatternsyntax (qregexp: wildcard); you can set metacharacters to the unified mode. In the unified mode, only three metacharacters are available. Their functions remain unchanged.
? Match any single character, for example, 1? 2 can be 1, followed by any single character, followed by 2
* Match any character sequence. For example, 1*2 can be 1, followed by any number of characters, followed by 2
[] Matches a defined Character Set combination. for example, [A-Za-z/.] it can match any character and. [^ A] matches characters other than lowercase.
Iii. Escape Sequence
/. Match "."
/^ Match "^"
/$ Match "$"
/[Match "["
/] Match "]"
/* Match "*"
/+ Match "+"
/? Match "? "
/B matches the bell character to make the computer beep.
/T tabulation symbol
/N newline characters
/R carriage return
/S arbitrary space
/Xnn matches the hexadecimal NN characters
/0nn matches 8-digit NN characters
These expressions start with "/" and are the same as the escape characters of C ++. to define an escape sequence in qregexp,
You need to add two //