Reg expressions

(matches one "e" or multiple "e")

 

 

 (matches one "e" and matches ea if there are any, so a is optional)

 

 (matches 'a' 0 or more, so it matches e, ea, eaaaa,  )

(matches anything once except new lines)

 

 

 (matches endpoint)

 

 (matches any letters) \w* will not work !!!; in order to match a string between 4-5 characters long, we can use \w{4,5};

{} means matching a length between 4 to 5.

 

 (matches anything not the letters)

 

 ([] means matching between f or c)

 

 

 (matches character between a-z or A-Z or 0-9)

 

 (means matches t or T)

 

 (means matches two or three of 't', 'e', 'r')

 

 

 (matches empty spaces)

 

 (negative version of \s, matches anything but not empty spaces)

 

 

 (another example of matching)

 

 

 

 

 

 

 

 

 

 

 

 

 https://www.youtube.com/watch?v=rhzKDrUiJVk

 

https://www.cnblogs.com/xiaoxie2014/p/9347620.html

 

posted @ 2020-11-13 14:53  John_K  阅读(77)  评论(0)    收藏  举报