python - Regular expression match string and then next two lines -
i want match following string:
window.universal = { yada yada ydada..... };
the following return first line. need next 2 well
re.search(r'.*window.universal.*', content).group(0)
i tired re.multiline, \s
- you need dotall.
- also 2
.*
give dotall.
try this:
re.search(r'window.universal = {.*?};',content,re.dotall).group(0)
Comments
Post a Comment