regex - how to match whitespace and alphanumeric characters in python -


hey guys im trying match string has space in middle , alphanumeric characters so:

test = django cms 

i have tried matching using follwing pattern:

patter = '\s' 

unfortunately matches whitespace, when match found using search method in re object, returns whitespace, not entire string, how can change pattern returns entire string when finding match ?

import re  test = "this matches" match = re.match('(\w+\s\w+)', test) print match.groups() 

returns

('this matches',) 

Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

java - Getting corefrences with Standard corenlp package -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -