Skip to main content
Inspiring
January 27, 2021
Question

Find and Replace in Files

  • January 27, 2021
  • 3 replies
  • 528 views

Hi all.

I have many entries to change using 'find and replace in files'.

My question is:

Can I use a wildcard in my searches?

For example * inside "" .

If wanting to change hundreds of different entries after data-lightbox="*" , where * is the variable and then replace all the finds with say "new entry" data-lightbox="new entry".

 

    This topic has been closed for replies.

    3 replies

    Participant
    January 28, 2021

    Hi, 
    Please Try this:
    Hit Ctrl/Cmnd + Shift + F > Advanced > Mystery Martini Glass Icon > Check "Use Regular Expressions" 

    BigDingusAuthor
    Inspiring
    January 29, 2021

    Thanks for the input folks. 
    I managed to achieve my goal using your suggestions but in a round about way. 
    Hope Adobe update or make this a bit easier for folks at my level. 

    Nancy OShea
    Community Expert
    Community Expert
    January 27, 2021

    For RegEx challenged folks like me, Advanced F&R might be all you need.  See screenshot.

     

     

    Hope that helps.

     

    Nancy O'Shea— Product User & Community Expert
    BigDingusAuthor
    Inspiring
    January 27, 2021

    Thanks Nancy.

    This is replacing one string with no variables.

    For instance data-lightbox=" with data-lightbox="new data"

    My search needs to encompass lots of different variables between " and "

    For example:

    data-lightbox="Sunrise @2926_2.jpg"

    data-lightbox="Sunrise-1.jpg"

    data-lightbox="StAsunset.jpg"

    I have hundreds of different file names in many directories and all need to be changed to one value.

    data-lightbox="New Name"

    So my search need to be able to find data-lightbox="Any character"

    Or am I wrong Nancy in how advanced works?

    Nancy OShea
    Community Expert
    Community Expert
    January 27, 2021

    Right.  Any value = any value.

    foo.jpg

    FOO.JPG

    foo_fighters.jpg

    folder/foo.jpg

    folder/folder/foo.jpg

    etc...

     

    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Community Expert
    January 27, 2021

    Dreamweaver allows the use of Regular Expressions in the F&R tool.

    Hit Ctrl/Cmnd + Shift + F > Advanced > Mystery Martini Glass Icon > Check "Use Regular Expressions" 



    This might help get you started: https://www.peachpit.com/articles/article.aspx?p=1927738&seqNum=19

    For some reason, Adobe has deleted the 2 part tutorial it used to have available in the forum. It's a shame. The info was old, but it was still accurate.

     

    BigDingusAuthor
    Inspiring
    January 27, 2021

    Thanks Jon that did help a lot. Very good article.

    However, perhaps I'm being stupid. I can't get it to look at data-lightbox="Sunrise-1.jpg"

    The search stops at data-lightbox="S while I need it to go all the way to the end (") or even the last .jpg

    I've tried different combinations, the last one being data-lightbox="[\w] and data-lightbox="[\w]JPG>