This script selects all the occurrences in the current document of the given regex. I'm posting it here as it's coming up a few times and so people might find it useful, if even they don't use Python Script normally.
It operates on either the current selection if something is selected, or over the whole document if there's no current selection.
This script selects all the occurrences in the current document of the given regex. I'm posting it here as it's coming up a few times and so people might find it useful, if even they don't use Python Script normally.
It operates on either the current selection if something is selected, or over the whole document if there's no current selection.
How do I do this with the new research method, where the matchFunction only seems to receive the match object as a parameter, not the line number?
Sorry if this is a dumb question, I am new to PythonScript and Python.
This seems to be a valid porting from the old pysearch() to the new research():