Page 1 of 1

Find/Replace with variable number strings

Posted: Fri Jul 01, 2022 1:39 am
by DonnaJ
I have code that looks like this:
/hc/article_attachments/5022597652123/

That I want to replace with this:
../_images/_stock_web/

The problem is that string of numbers in the find segment is different for every instance and of variable length, too.
What wild card can I use for that?
Thanks,
Donna

Re: Find/Replace with variable number strings

Posted: Fri Jul 01, 2022 6:52 am
by Radu
Hi Donna,

In the find/replace dialog you are using there should be a a "Regular expression" checkbox that you need to check, then you can search for:

/hc/article_attachments/(.*)

and for the replacement string use for example:

../_images/_stock_web/

That $1 in the replacement string will expand to the first grouping in the search string which is the sequence of figures.

https://www.oxygenxml.com/doc/versions/ ... sions.html

Regards,
Radu