in reply to look-ahead and look behind!!
The match string for a look behind match must match a fixed number of characters. That means that ?, *, + and {n, m} are not allowed because they can match a variable number of characters. It also means that if you use |, each clause must be the same length.
If you really, really must use a look behind to match the first a then you could:
$str =~ /(?<=^a)/;
but all you actually need is /a/.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: look-ahead and look behind!!
by narainhere (Monk) on Oct 22, 2007 at 10:29 UTC | |
by GrandFather (Saint) on Oct 22, 2007 at 10:37 UTC |