1, ^ symbol---the beginning of a row
// returns an array of text immediately beginning with C, immediately following a T!
2, $---Represents the end of a line
// returns the text array output that ends with Y, followed by the previous one, R : Ry
3. [...] Indicates that a character group is used to match a string of characters
If we need to search for the word "gray", but also not sure if he writes "Gray", this time you can use the regular expression structure [...] -Character groups. He allows the user to list characters that they want to match within a character group.
E means match character e,a means match character A,[ea] means match A or e, so to match "gray" can write this: Gr[ea]y, the first to find a G, followed by an R, then an E or a, immediately after this last is Y.
Note: The internal match in the character group is not the same as the outside, he represents the or.
// The return begins with G, followed by an R, followed by A or e, followed by a Y output: Gray
You can enumerate any number of characters in a group of characters, for example [123456] matches any number in 1 to 6, which can be used as part of "h<123456>" to match
3.1 Character Group Metacharacters
Within a character group, the character group metacharacters '-' (hyphens) represent a range, as follows, ' <H[1-6]> ' and ' <H[123456]> ' are the same!
' [0-9] ' and ' [A-z] ' are common ways to match commonly used numbers and lowercase sub-females! can also be multi-range is allowed, for example, we want to match a word must start with an alphabetical array underscore, the code can write:
Regular expression unary characters and character groups