[TxMt] search and replace

jeff newman bangersandmash at gmail.com
Mon Feb 12 02:34:52 UTC 2007


Hi Charilaos,

> First way (using a group to match the text we want to keep, and use  
> $1 to refer to it in the substitution string):
> Search for: (\d{4}\.)\s
> Replace by: $1\n

This worked perfectly (aside from the single exception that you  
pointed out:
>
> Btw, you would probably want \s+ in those instead of just \s, to  
> absorb more than one spaces, if that happens. Keep in mind, this  
> method of yours will also break at the "Year 2000." line below. Not  
> easy to avoid that though, hopefully it's only a few cases.

Greatly appreciated!

-- 
j.






More information about the textmate mailing list