[texworks] Back references

Mark Yagnatinsky markyag at gmail.com
Tue Jul 14 08:30:38 CEST 2015


That's awesome!  Maybe the manual should be updated to reflect this?
The manual currently gives no hint that this works in replace, as well
in find.  Or is this supposed to be obvious?  (In retrospect I admit
to feeling a bit silly about not realizing that the parens are
needed.)

On Tue, Jul 14, 2015 at 2:17 AM, Jonathan Kew <jfkthame at gmail.com> wrote:
> 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?
>
>
> Replace:
>
>   Activity (\d{1,2})
>
> with:
>
>   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