regex - regular expression to find a number after a substring in python -
i have string:
string = "tic_signal_12 ((task)(0))"
by using regular expressions, want number after "(task)" substring not know how build expression
use \d*
match non-digit chars.
>>> import re >>> string = "tic_signal_12 ((task)(0))" >>> re.search(r'\(task\)\d*(\d+)', string).group(1) '0'
Comments
Post a Comment