You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
first thank you very much @kkos for this wonderful library! ❤️
As you may know, the PHP language uses Oniguruma (currently v5.9.6) as the regexp engine for it's mbstring extension.
The PHP documentation on Oniguruma is unfortunately close to non-existent, so I'm currently trying to contribute a small reference chapter about it's syntax and distinctive features.
However I'm having a hard time to understand the "backreference with nesting level" feature.
What I currently understand is that they allow referencing the result of a subexpression up or down the subexpression call stack. Is that right?
For example considering this simplified version of example 2 from the docs:
It's pretty clear to me that we ask the engine to refer to the result of the <name> subexpr at the current nesting level instead of referring to it's last captured value.
But in the original version from the docs, you use \k<name+1>.
So you're asking for the result of <name> one level deeper than the current nesting level.
I don't understand why this works and why \k<name+0> doesn't.
Would you mind enlightening me on the subject?
That would help me greatly in documenting the feature!
Thanks again!
The text was updated successfully, but these errors were encountered:
Hi,
first thank you very much @kkos for this wonderful library! ❤️
As you may know, the PHP language uses Oniguruma (currently v5.9.6) as the regexp engine for it's mbstring extension.
The PHP documentation on Oniguruma is unfortunately close to non-existent, so I'm currently trying to contribute a small reference chapter about it's syntax and distinctive features.
However I'm having a hard time to understand the "backreference with nesting level" feature.
What I currently understand is that they allow referencing the result of a subexpression up or down the subexpression call stack. Is that right?
For example considering this simplified version of example 2 from the docs:
It's pretty clear to me that we ask the engine to refer to the result of the
<name>
subexpr at the current nesting level instead of referring to it's last captured value.But in the original version from the docs, you use
\k<name+1>
.So you're asking for the result of
<name>
one level deeper than the current nesting level.I don't understand why this works and why
\k<name+0>
doesn't.Would you mind enlightening me on the subject?
That would help me greatly in documenting the feature!
Thanks again!
The text was updated successfully, but these errors were encountered: