Jump to content

(simple) Escaping In RegEx?


livethedead

Recommended Posts

I'm learning PHP as my first language so bear with me.

 

I seriously cannot figure out how to escape the (/) in this regex for a url.

 	$facebook = preg_replace("/facebook.org/\|facebook.net/\/i", 
"/facebook.com/\/i", trim($_REQUEST['facebook_url'])); 

 

 

Warning: preg_replace() [function.preg-replace]: Unknown modifier '\'

 

edit: Sorry I thought I posted this in the regex forum.

Link to comment
https://forums.phpfreaks.com/topic/256967-simple-escaping-in-regex/
Share on other sites

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.