Woundorf / foxreplace

Replace text in webpages
https://addons.mozilla.org/firefox/addon/foxreplace/
GNU General Public License v3.0
90 stars 22 forks source link

Regular expressionss with matching groups #349

Closed Eidonko closed 1 year ago

Eidonko commented 1 year ago

Dear Sir, I wanted to filter the contents of a web page such that strings like "Figure 31 42" would be changed into "Figure 31" (thus, skipping the second number) I have tried to apply the following regex: (Figure)([ ])([0-9])([ ])([0-9]) and specified to change it with "Figure \3", where "\3" would be the third matching group. Regrettably the text was changed into "Figure \3", that is, the \3 was not interpreted as a matching group. Would it be possible to apply regex with matching groups? Thank you very much! Kind regards, eidon

Woundorf commented 1 year ago

Hi, sorry for the late reply. You need to use the JavaScript conventions, and thus use $3 instead of \3.

Eidonko commented 1 year ago

Oh I see! Thank you very much!

-- Sent with Tutanota, enjoy secure & ad-free emails.

Jul 5, 2023, 12:45 by @.***:

Hi, sorry for the late reply. You need to use the JavaScript conventions, and thus use > $3> instead of > \3> .

— Reply to this email directly, > view it on GitHub https://github.com/Woundorf/foxreplace/issues/349#issuecomment-1621503816> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AJNTG2ZNZ7NGKPYLSUZLL7TXOVAS7ANCNFSM6AAAAAAZVRTCGA> . You are receiving this because you authored the thread.> Message ID: > <Woundorf/foxreplace/issues/349/1621503816> @> github> .> com>