[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RE for any text, including white space

From: PJ Weisberg
Subject: Re: RE for any text, including white space
Date: Wed, 16 Mar 2011 12:40:22 -0700

On 3/16/11, ken <address@hidden> wrote:
> What's the RE for any text, white space included?  I also want to grab
> (for match-string...) this text.  The text is bounded by known
> characters.  E.g.,
> <h3>Any Text-- <a name="thisname">
> Hot Stuff</h3
> In the above, how to grab the text of the title, i.e., everything
> between <h3> and </h3>?  Conceivably this title text might contain
> *anything* except "</[Hh]{1-9]".

If A and B are your start and end points, then you want:


You probably got thrown off by the fact that '.' matches anything
EXCEPT a newline.  Regexps are usually assumed to be line-based.

The '?' is there to make the '*' non-greedy, to prevent it from
matching everything between the first A and the last B in the whole

The double '\'s are necessary in lisp code because it's interpreted as
a string before it's passed to the regexp engine.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]