Regular Expression, Regular Expression
Regular Expressions are arranged by special characters to find, replace, and delete one or more character strings. In short, regular expressions are an "expression" used to process strings ", is a standard basis for string processing.
Regular Expressions are classified:Basic Regular ExpressionAndExtended Regular Expression.
These are all summarized by the big guys, including the basics and extensions.
I. Basic Regular Expressions
(1 ),^ Word: The string (word) to be searched at the beginning of the line
(2 ),Word $: The string (word) to be searched at the end of the row
(3 ),.: Represents a character that must contain any character
For example, there must be a character in the middle of 'G. G '.
(4 ),\: Escape characters to remove the special meaning of special symbols
For example, '\ *' searches for characters *
(5 ),*: Repeats the first character from 0 to infinity.
For example, 'so * 'is used to search for strings such as so, soo, and sooo.
(6 ),[List]: Find the desired character from the RE character of the character set.
For example, 'a [rc] t' indicates a character in art, act, and [].
(7 ),N1-n2: Find the range of characters to be selected from the RE characters of the character set.
(8 ),[^ List]: Find unwanted characters or ranges from the RE characters in the character set.
(9 ),\ {N, m \}: The first character of n to m consecutive. If it is \ {n \}, it is the first character of n consecutive times.
Ii. Extended Regular Expressions
(1 ),+: Repeat one or more previous RE characters
For example, 'Go + d' is used to search for strings such as good and goood.
(2 ),?: 0 or the first character of one
(3 ),|: Search by or
For example, 'good | better' searches for good and better.
(4 ),(): Search for the "Group" String
For example, 'G (oo | la) 'is used to find good or gglad, which is similar to [list ].
(5 ),() +: Identification of multiple repeated groups