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.

Try this:
findText all regularExpression replaceWith "callp $1()" "exsr
(\\S*)"

'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
non-blank characters.

Hope that helps. You can use this in the Find dialogue box as well
(Ctrl-F) but I'm old fashioned.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.