Product Site

5.4.15.5. position

Returns the character position at which the last parse, pos, or match method ended.
Example 5.279. RegularExpression class — position method
re = .RegularExpression~new
re~parse("[abc")                    -- illegal set definition
say re~position                     -- will be 4

re = .RegularExpression~new("[abc]12")
re~match("c12")
say re~position                     -- will be 3

re~match("a13")                     -- unsuccessful match
say re~position                     -- will be 2 (failure to match)

::requires "rxregexp.cls"