Regular Expressions and the re module

A: Regular Expressions

【1】

(1) Definition: a string of well defined manner of operation of the string

(2) Function: Filter the data to match

 

【2】

(1) simulation scenarios: http://tool.chinaz.com/regex/

 

(2) string:

  (1) Definition: a group of more characters may appear in the same location 

  (2) forms: []

 

(3) table to form groups of characters:

expression Matching character result  explain
[0123456789] 6 True 0-9 match any number
[0-9] x False Matching digital non-alphabetic
[a-z] x True Az matches all lowercase letters
[A-Z] A True AZ matches all uppercase letters

Guess you like

Origin www.cnblogs.com/SR-Program/p/11202955.html