Python/Regex: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
(Created page with "= To Match = <source lang="python"> if re.search(pattern, subject): pass m = re.match(pattern, subject) if m: pass </source> = To Replace = <source lang="python"> ns...")
(No difference)

Revision as of 07:26, 31 May 2018

To Match

if re.search(pattern, subject):
    pass

m = re.match(pattern, subject)
if m:
    pass

To Replace

ns = re.sub('o+', '_', 'doooooog')