python - Verify Regex Pattern to find email address in HTML -


new regex , python: verify what's wrong below regex pattern find email address in html code:

test_str = ("html-code")  regex = re.compile(r"[\w._%+-]{1-20}@[\w.-]{2,20}.[a-za-z]{2,3}") matches = re.findall(regex, test_str) 

getting out empty array.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -