regex - how to match any string in Emacs regexp? -


i'm referring page: http://ergoemacs.org/emacs/emacs_regex.html

which says capture pattern in emacs regexp, need escape paren this: \(mypattern\).

it further says syntax capturing sequence of ascii characters [[:ascii:]]+

in document, i'm trying match strings occur between <p class="calibre3"> , </p>

so, following syntax above, replace-regexp

<p class="calibre3">\([[:ascii:]]+\)</p>

but finds no matches.

suggestions?

regexps not general-purpose html parsing, paragraph tags cannot validly nested, following going fine (provided mark-up valid & well-formed).

<p class="calibre3">\(.*?\)</p> 

*? non-greedy zero-or-more repetitions operator, match little possible -- in case until next </p> (as opposed greedy version, match until final </p> in text).

the [^<] approach fine if fits data in question, won't work if there other tags within paragraphs.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -