Regex

This topic is: resolved

 

Thank you for contacting me. Please note that I live in the GMT+3 time zone - responses might be delayed by this.

Viewing 2 reply threads
  • Author
    Posts
    • #10231


      [email protected]
      Participant
      Post count: 12

      Hi

      First of all, thanks for this fabulous plugin.

      I need to change the following gallery image url’s using regex replace.

      graphics/00000001/2/HH18T_150x150.jpg

      to

      mm5/graphics/00000001/2/HH18T.jpg

      I was able to replace graphics/ with mm5/graphics/

      How would I replace the last part _150x150.jpg with .jpg or whatever file extension?

      Same question for the featured image.

      Thanks in advance

    • #10232


      Szabi – CodeRevolution
      Keymaster
      Post count: 4195

      Hello,

      First of all, thank you for your purchase.

      Please try:

      Run Regex On Gallery Images:
      #(graphics\/\d+\/\d+\/[\s\S]*?)_150x150\.jpg#
      Replace Matches From Regex (Gallery Images):
      mm5/$1.jpg

      Regards, Szabi – CodeRevolution.

    • #10233


      [email protected]
      Participant
      Post count: 12

      Thanks for your help.

Viewing 2 reply threads

The topic ‘Regex’ is closed to new replies.