in reply to RE Dropping last Character

my  @splits = split(/(?<!\\),/,$str);

Replies are listed 'Best First'.
Re: Re: RE Dropping last Character
by allolex (Curate) on Jun 11, 2003 at 19:38 UTC

    And since we're supposed to be learning something here =)...

    "(?<!pattern)"
    A zero-width negative look-behind assertion. For example "/(?<!bar)foo/" matches any occurrence of "foo" that does not follow "bar". Works only for fixed-width look-behind.

    That's right, a negative, look-behind assertion. It's under "Extended Patterns" in perldoc perlre.

    --
    Allolex