I have downloaded PSPad to perform automatic edits to programs which run machine
tools where I work. 

I need to make a macro using search and replace to take all one or two digit
numbers after a "T" and move them after the next occurrence of "M6" (with a
"T").

Example

_T77_
G90G55G17G0X33.138Y36.944
G43Z25.H76S300M3
Z25.M8
G1Z-17.5F1500.
X34.879Y27.071F90.
_M6_

needs to end up as

_T77_
G90G55G17G0X33.138Y36.944
G43Z25.H76S300M3
Z25.M8
G1Z-17.5F1500.
X34.879Y27.071F90.
_M6T77_

The text in between the T** could be pages long. 

There will be no other "T"s and no occurrences of "M" without a "6" after. 

No lower case letters

In word I did this with

find       <T(*)(*)>*M6
replace    ^&T\1\2

The * referred to all the intervening text nicely.

I can't seem to do this with regular expressions. Help me Mr. Wizard.

-- 
<http://forum.pspad.com/read.php?2,59606,59606>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem