[Israel.pm] regex question

Avishalom Shalit avishalom at gmail.com
Tue Jan 5 05:32:06 PST 2010


Hey Amir,
It looks like you were trying to attach this image to your penultimate paragraph
http://www.pseale.com/blog/content/binary/clippy.png


-- vish



2010/1/5 Amir E. Aharoni <amir.aharoni at mail.huji.ac.il>:
> On Tue, Jan 5, 2010 at 14:39, Yossi Itzkovich
> <Yossi.Itzkovich at ecitele.com> wrote:
>>
>> Hi,
>> I need to catch a text between, for example, the word "myWord" and a word which is not "myWord".
>> I can do it like :  m~\bmyWord\b(.+?)\b[^m][^y][^W][^o][^r][^d]\b~  but I guess there is a much better alternative.
>>
>> Thanks in advance
>
> I am not sure that i completely understood what you want to
> accomplish. Can you send some examples of string that should and
> should not match?
>
> In any case, it sounds like you're searching for Look-Around
> Assertions, which i use very often. Take a look at:
>
> http://perldoc.perl.org/perlre.html#Look-Around-Assertions
>
> --
> אָמִיר אֱלִישָׁע אַהֲרוֹנִי
> Amir Elisha Aharoni
>
> http://aharoni.wordpress.com
>
> "We're living in pieces,
> I want to live in peace." - T. Moore
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://mail.perl.org.il/mailman/listinfo/perl


More information about the Perl mailing list