+ 2

Regular Expression

How to use regular expression to find 'Roy' in string: Roy plays football.

29th Jun 2018, 4:18 AM
Shivanshu Gupta
Shivanshu Gupta - avatar
1 Respuesta
+ 3
import re text="Roy plays football." p=re.search("Roy", text) if p: print ("Found Roy!") else: print ("No Roy found.")
30th Jun 2018, 2:57 PM
George Ryan
George Ryan - avatar