How to use regex capture groups/backreferences in Search & Replace? #2854
Unanswered
nevillepark
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, a big reason I use Markor is its search and replace function. I have successfully used regex capture groups in search, but is there a way to use backreferences when replacing text? I've tried
$1and\1but both just insert that verbatim rather than using the capture group.E. g. if I want to replace all instances of "AM" and "PM" with "A. M." and "P. M.",
(A|P)Mwill find both "AM" and "PM". If I put\1. M.in the Replace field, though, I don't get "A. M." and "P. M.", I get\1. M.Likewise with$1. M..Am I using the wrong character? Is there a proper way to use backreferences when replacing text? Or is this not a feature?
Beta Was this translation helpful? Give feedback.
All reactions