Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Latest commit

 

History

History
30 lines (30 loc) · 942 Bytes

README.md

File metadata and controls

30 lines (30 loc) · 942 Bytes

Python

Regular Expression

  • TODO: COMPLETE THIS SECTION
  • Import
    • import re
  • Rulse
    • \d Contains digits
    • \D Not Contains digits
    • \s Contains a white space
    • \S Not Contains a white space
    • \w Contains A-Z,a-z,0-9,_
    • \W Not Contains A-Z,a-z,0-9,_
    • \A At Beginning
    • \Z At End
    • \b At Beginning or At End
    • \B Not At Beginning or At End
    • [abc] a,b,c
    • [a-c] a to c
    • [^abc] Any except a,b,c
    • [357] 3,5,7
    • [123][645] 16, 14, ..., 35
    • [0-9]+ At least One Digit
    • [0-9]* At least Zero Digit like empty string
  • Methods
    • re.findall()
    • re.search()
      • Returns the position of first accurance
    • re.split()
    • re.sub()
  • Examples