replacefindtextwrangler

Textwrangler: How can I Replace \d+ with {\d+}?


I need to find and replace the text [n] with the text \textsuperscript{n}.

Where n is a number between 1-99.

EG. the text [15] with the text \textsuperscript{15}

I am not a programmer but think grep is my friend here.

I have tried: Find: \[\d+\] Replace: \\textsuperscript{\d+} this finds the numbers but replaces them with \textsuperscript{\d+} (predictably).

Where am I going wrong please?

Thanks for your help. Found the solution over on Google Groups for Textwrangler. Apparently I needed a subpattern.

Find: \[(\d+)\]

Repalce: \\textsuperscript\{\1}

Here is a link to the Solution


Solution

  • Thanks for your help. Found the solution over on Google Groups for Textwrangler. Apparently I needed a subpattern.

    Find: \[(\d+)\]

    Repalce: \\textsuperscript\{\1}

    Here is a link to the Solution