On 6/25/2014 4:04 PM, darren@xxxxxxxxx wrote:
That replaces the exsr $Main great, thanks. I guess I need to read up on
how regular expression work, since I want to replace all of the exsr, and
not just $Main.
findText all regularExpression replaceWith "callp $1()" "exsr
'all' means to replace all occurrences.
the replaceWith includes the proper spacing between the opcode and
factor 2. The special thing there is the '$1' - this says to insert the
code stored in regex group 1. More in a moment. The '()' is just
parens to tack on to the end of the former subroutine name.
The search string searches for exsr and the proper number of spaces
between the opcode and factor 2. Then, it lumps the next bit of text
into group 1 - that's what the parens mean here inside the search
string. There is a special search term that means 'anything but white
space' and that is '\S' (the capital S is important). Of course,
backslash is a special character; it is the 'escape' character. As
such, it needs to be escaped. With a backslash. This is similar to the
apostrophe in RPG. "10 O'Clock" needs to be written '10 O''Clock'.
Anyway. The * after the \\S means 'any number of those'.
So the regex is looking for exsr, 6 spaces and then any number of
Hope that helps. You can use this in the Find dialogue box as well
(Ctrl-F) but I'm old fashioned.
As an Amazon Associate we earn from qualifying purchases.