[ Please do not top-post! ]

epanda wrote:
Gunnar Hjalmarsson wrote:
epanda wrote:
I would like to identify in a pattern a number wich is not

        preceded by     another number    a word or a ';'
        followed
by       ;number
~      ;\d+

I have tried this  s/\d+(?<!\w)/aWord/g  without success.

You probably want to reverse the order.

    /(?<!\w)\d+/

In fact I would like my number is not preceded by a   <word;> or a
<number;>

I have tried that but error :
s/(?<!(\w|\d+;))(\d+)(?!(;\d+|\d+|;\s+\d+;\d+))/: variable length
lookbehind not implemented at HashTableItems.pl line 207

Yes, as is stated in "perldoc perlre", "(?<!pattern)" works only for fixed-width look-behind. Hence you may not use the "+" quantifier.

You know that the \w character class includes digits, right?

Maybe I'm dumb, but it's not clear to me what you want to achieve. It might be easier to help you if you showed us a few _examples_, both of strings that should match and strings that should not match.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to