in reply to Is the skip: directive broken in Parse::RecDescent ? [Solved - PEBKAC]
<skip:qr/#\w+/> 'foo' 'bar'
is equivalent to
/(?>#\w+)(?>foo)(?>#\w+)(?>bar)/
/#\w+/ isn't matched by the "#skdjslkdjsakdjadjlksa\n" before "foo" (note the newline).
/#\w+/ isn't matched by the "" before "bar".
I think you want <skip:qr/(?:#\w+\n)?/>
By the way,
/#\w+/ 'foo' 'bar'
is equivalent to
/(?>\s*)(?>#\w+)(?>\s*)(?>foo)(?>\s*)(?>bar)/
since the default skip is /\s*/.
Update: Added "by the way" bit.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is the skip: directive broken in Parse::RecDescent ?
by Hercynium (Hermit) on Aug 11, 2008 at 22:01 UTC | |
by ikegami (Patriarch) on Aug 11, 2008 at 22:22 UTC | |
by Hercynium (Hermit) on Aug 12, 2008 at 16:02 UTC |