开发者

Return match position in String.scan

I need to scan larger text documents for patterns expressed in regular expressions and extrac开发者_StackOverflow社区t 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?


Check out this post.

It works on a match object. m.begin(1)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜