On Tue, Jan 5, 2010 at 14:39, Yossi Itzkovich
<[email protected]> 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
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to