P
Phil Tomson
Apparently oniguruma supports look-behind. Is there any documentation on how
to use this feature?
for example, if I had the string "~ABC~DE" and I want to return a list of
letters in the string which are preceeded by '~' ( ['A','D'] in this case) how
might I use the look-behind feature in oniguruma to achieve this? or, how
would I get a list of letters in the string which are not preceeded by '~'
(['B','C', 'E'] in this example.
(I know there are other ways of doing this, I'm just posing this as an example
of using look-behind).
Here's one that's a bit trickier: What if I had "~(ABC)DE" and I want the
tilde (a negation operator) to apply to each letter within the parens that it
preceeds, so that I would get ['A','B','C'], but in the case where the input
string is "(ABC)DE" I would get an empty list.... and then of course I would
want them to be nestable: "~(~ABC)" ('A' should not appear in the list in this
case since it's doubly negated - OK, that's probably going too far and
maybe it's getting to the point where I should break out RACC ;-)
Phil
to use this feature?
for example, if I had the string "~ABC~DE" and I want to return a list of
letters in the string which are preceeded by '~' ( ['A','D'] in this case) how
might I use the look-behind feature in oniguruma to achieve this? or, how
would I get a list of letters in the string which are not preceeded by '~'
(['B','C', 'E'] in this example.
(I know there are other ways of doing this, I'm just posing this as an example
of using look-behind).
Here's one that's a bit trickier: What if I had "~(ABC)DE" and I want the
tilde (a negation operator) to apply to each letter within the parens that it
preceeds, so that I would get ['A','B','C'], but in the case where the input
string is "(ABC)DE" I would get an empty list.... and then of course I would
want them to be nestable: "~(~ABC)" ('A' should not appear in the list in this
case since it's doubly negated - OK, that's probably going too far and
maybe it's getting to the point where I should break out RACC ;-)
Phil