What is the correct way to account for spaces in a regular expression? [duplicate]
Solution 1:
Try this:
((.|\n)*)<FooBar>
It basically says "any character or a newline" repeated zero or more times.
Solution 2:
It depends on the language, but there should be a modifier that you can add to the regex pattern. In PHP it is:
/(.*)<FooBar>/s
The s at the end causes the dot to match all characters including newlines.