Reputation: 125
i try to find and replace everything between:
<div id="foot">
and <div id="foot_space">
following regular expressions I've already tested:
<div id="foot">(.*?)<div id="foot_space">
#<div id="foot">(.*?)<div id="foot_space">#
The Code looks like:
<div id="foot">
Lorem Ipsum <span>Highlight</span>
</div>
<div id="foot_space"></div>
The remote and file search do not find any matches :-(
Upvotes: 3
Views: 136
Reputation: 170138
The .
probably does not match \r
and \n
. Try this:
(?s)<div id="foot">(.*?)<div id="foot_space">
or this:
<div id="foot">([\s\S]*?)<div id="foot_space">
The (?s)
enables DOT-ALL, and [\s\S]
matches any character. So [\s\S]
and (?s).
is the same in many regex implementations.
I'd also replace the literal spaces with a \s+
if I were you.
Upvotes: 4