\ {\} in regular expressions-- the number of times matching patterns occur
Regular expression:
The number of times matching characters appear
Use * to match all the matching results once, but if you only need to set the number of times, you should use\ {}. There are three forms of this pattern.
Pattern\ {n\} matching pattern occurs n times
Pattern\ {n,\} matching patterns occur at least n times
Pattern\ {NMagne m\} matching pattern occurs n to m times, and nMagne m is an arbitrary integer between 0 and 255respectively.
Example:
A\ {2\} B matching value is AAB
A\ {4\} B matching value is AAAAB or AAAAAAB, but cannot be AAAB
A\ {3pm 5\} matching value is AAAB,AAAAB,AAAAAB
Note: it is not difficult for regular expressions to use a single metacharacter, especially if multiple metacharacter sets are mixed.
Grep'^ H. [Amurz Zjinaqizi] s\ {2pr 4\} c$'./test