[texworks] Back references

Jonathan Kew jfkthame at gmail.com
Tue Jul 14 08:17:41 CEST 2015

On 12/7/15 03:23, Rajan Ananthan wrote:
> Are back-references supported in the Find and Replace regex expressions?
> I want to find a one or two digit number:
> Activity [\d]{1,2}
> And replace with the same match but with new line appended
> Activity \1 \\\\
> This replaces all occurrences with the \1 literal and not its value.
> What is the proper syntax?


   Activity (\d{1,2})


   Activity \1 \\\\

should work.

The important point being the "capturing" parentheses around the part of 
the match that you want to reference.

More information about the texworks mailing list