http://qs321.pair.com?node_id=801110


in reply to Text match

See for example How do I retrieve the position of the first occurrence of a match? to get the position of the match. Then you could just use substr.

Update: didn't read your question carefully, thought you were talking about characters, not lines.