String manipulation is one of the most common programming work.
It is very difficult to search and position strings with complicated logic.
As a result, RE technique was developed and has been used for decades.
Regular Expression is a high-level matching mode; whose nature is a string that composed by a series of characters and particular symbols.
We can describe some string rules by combine the normal characters and the characters which has special meaning. The rules can stand for repeating, positions, .etc; which can be used for expressing and thus matching those specific string.
Goals for learning RE
Be able to proficiently handle the MetaCharacters.
Be able to read and edit the common REs.
Be able to proficiently use the re module in Python.
Matching Rule: Each normal character matches its corresponding character.
e.g. In : re.findall('ab',"abcdefabcd") Out: ['ab', 'ab']
Note: The Regular Expression in Python can also be used for matching non-English characters.
Logic -> OR
Metacharacter: " | " (pipe)
Matching Rule: To match a string which can fulfill anyone of the two rules aside the "|" symbol.
e.g. In : re.findall('com|cn',"www.baidu.com/www.tmooc.cn") Out: ['com', 'cn']
Matching a single character
Metacharacter: " . " (dot)
Matching Rule: Matching any character except "\n"
e.g. In : re.findall('张.丰',"张三丰,张四丰,张五丰") Out: ['张三丰', '张四丰', '张五丰']
Matching Character Classses
Metacharacter: [Character Class]
Matching Rule: Matching any character inside the character class.
In the character class [abc#!好], the square bracket  中的任意一个字符[0-9],[a-z],[A-Z] 表示区间内的任意一个字符[_#?0-9a-z] 混合书写，一般区间表达写在后面
e.g. In : re.findall('[aeiou]',"How are you!") Out: ['o', 'a', 'e', 'o', 'u']
Matching the reverse set of a character class
e.g. In : re.findall('[^0-9]',"Use 007 port") Out: ['U', 's', 'e', ' ', ' ', 'p', 'o', 'r', 't']
Matching a target at the head of the string
e.g. In : re.findall('^Jame',"Jame,hello") Out: ['Jame']
Matching the target at the tail of the string
Metacharacter: $ (dollar)
e.g. In : re.findall('Jame$',"Hi,Jame") Out: ['Jame']