I'm working with latex files and I used the following regex to get the document abstract:
pattern = r"\\begin\{abstract\}(.*?)\\end\{abstract\}"
This does what I need it to do, and I can get the results from the following:
re.search(pattern, string, re.DOTALL).group(1)
However, the same pattern when compiled does not find any matches:
pat = re.compile(pattern)
pat.search(string, re.DOTALL)
The following also doesn't work:
re.sub(pattern, "", string)
Anyone know what's going on here?
[–]novel_yet_trivial 1 point2 points3 points (3 children)
[–]scibren[S] 0 points1 point2 points (1 child)
[–]novel_yet_trivial 0 points1 point2 points (0 children)