-1

I have a text file containing only text lines like this:

(abc) defghjklmnop

I want the whole bracket to be at the end. So it should look like this:

defghjklmnop (abc)

The text in the bracket and the text after it vary from line to line. How can I do this in TextWrangler?

mdcq
  • 1,593
  • 13
  • 30

1 Answers1

1

Search for this:

(\(.*\))(\s)(.*)

and replace it with this (using back references to the groups in parentheses above):

\3\2\1

This will also preserve the whitespace between the two groups.

Brendan Ritchie
  • 2,285
  • 15
  • 22