Regular Expressions:
\{\} matches the number of occurrences of a character
Use * to match all matching results once, but if you set the number of times, you should use \{\}, this mode has three forms.
Pattern\{n\} match pattern appears n times
Pattern\{n,\} match pattern appears at least n times
Pattern\{n,m\} match pattern appears n to M times, N,m is any integer between 0-255
Cases:
A\{2\}b Match value is AaB
A\{4\}b Match value is Aaaab or Aaaaaab, but cannot be Aaab
A\{3,5\} match value is Aaab,aaaab,aaaaab
Note: Regular expression single metacharacters are not difficult to use, especially if multiple meta-character sets appear mixed
grep ' ^h.[a-z,a-z]s\{2,4\}c$'./test
This article is from the "Not So Simple" blog, be sure to keep this source http://hungss5657.blog.51cto.com/8011603/1631374
\{\} in regular expression--number of occurrences of the matching pattern