How Do I Use RegEx on RTF Text and Retain Formatting?

Hey Steve,

Not with normal text-based find/replace utilities.

Jedit Omega can do regex on styled text, and there are other apps like Tex-Edit Plus (although TEP's syntax is not fabulous).

One method might be to use the textutil command line utility to convert RTF to HTML, manipulate the HTML, and convert back. (Search the forum for “textutil” and you'll find a few hits.)

I'm fairly sure this can be done using AppleScriptObjC, although you'd really want to ask Shane Stanley on the LNS Forum.

-Chris

1 Like