regex - Python testing if whitespace(\s) symbol is in string -


i have problem testing if "\s" symbols present in string. example '\sgoogle\s.com' must show there is.

# use raw strings ignore escapes: s = r'\sgoogle\s' print s, s.find(r'\s') != -1  # , regex: import re print re.search(r'\\s', s) 

gives:

\sgoogle\s true <_sre.sre_match object @ 0x7f2d696fc850> 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -