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

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

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -

collision detection - C++ library for mesh to mesh intersection: what is available? -