Find/Replace with variable number strings

Having trouble installing Oxygen? Got a bug to report? Post it all here.
DonnaJ
Posts: 3
Joined: Mon Mar 28, 2016 8:16 pm

Find/Replace with variable number strings

Post 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
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Find/Replace with variable number strings

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply