offset
Syntax
regexOffset(<needle>, <haystack>[, <skipCharacters>])
put offset("--.*", script of this project) into allComments
Explanation
The regexOffset
function finds the regular expression <needle>
in the string <haystack>
and returns
the position and length of each match as a comma-separated list so that it can be used to access the
found word with the character
chunk expression.
It returns an empty string if the requested needle regular expression could does not occur in the haystack string.
If you specify skipCharacters, offset
will skip that many characters at the start of the
haystack string before it starts searching. This allows you to search for the next result
after you’ve found something.