in reply to Re^2: perl indication of end of string already matched
in thread perl indication of end of string already matched
print 'pos at end' if pos $str == length $str;
This if statement is true whether or not the previous regex matched $.
I don't understand this. Can you give an example of a non-lookahead regex that matches to the end of a string and does not match at the end of the string, i.e. does not leave pos sitting beyond the end of the string (or pos == length)?
Using pos == length is sufficient. ... a simpler call ... avoid two calls ... and instead call one function ... I'm very sensitive to performance during parsing.
It sounds as if you may have an answer (even though I'm still a bit confused about the question). I imagine that Inline::C would allow you to define a single function to examine the internals of a string scalar and return info on pos versus length. Good luck :)
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: perl indication of end of string already matched
by nachumk (Initiate) on Jun 08, 2020 at 21:58 UTC | |
by haukex (Archbishop) on Jun 08, 2020 at 22:37 UTC | |
by AnomalousMonk (Archbishop) on Jun 09, 2020 at 00:40 UTC | |
by haukex (Archbishop) on Jun 09, 2020 at 08:29 UTC |