0
can we use spacebar in pattern and match with re module
import re pattern = r"Hi" if re.match(pattern, "baidya Hi"): print ("Match") else: print ("Not Match")
1 Respuesta
+ 1
You can use the special class char \s in regEx, which match all espacement characters ( normal space, tabulation, new line, and so on ), or use a custom class [ ] as well as the space char itself ( it's not a reserved char, unlike the dot '.' wich as the signification of 'whatever char' and need to be escaped )