I need to scan larger text documents for patterns expressed in regular expressions and extract a certain number of surrounding text tokens. At the moment I use String.scan to retrieve the matches, but this doesn’t give me the position of the matched string in the document. Is there some elegant solution for this?
I need to scan larger text documents for patterns expressed in regular expressions and
Share
Check out this post.
It works on a match object.
m.begin(1)