Jump to content

Quick REGEX help needed..


Chud37

Recommended Posts

I need to match

 

(Click to Enlarge)

 

WITH the brackets.  Its at the bottom of thumbnails and I want to remove it.  I cannot work out what REGEX to use, Im new to it! So far i've got:

 

{\(Click to Enlarge\)}

 

But that is returning nothing.  Could someone please tell me what the best thing to use is and why!

 

:)

Link to comment
https://forums.phpfreaks.com/topic/261528-quick-regex-help-needed/
Share on other sites

The pattern delimiter's need to be identical

 

Not quite true. You can also use  a pair of matching bracket-type characters such as <> and {}. I'm not sure why the regex you posted originally didn't work for you Chud37, it worked for me. Although there's really no need to use regex for simple string replacing. This would be much quicker:

 

$str = str_replace('(Click to Enlarge)', '', $str);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.