Jump to content

help me, new to regex...


DanDaBeginner

Recommended Posts

:) please patient with my codes i am totally new when it comes to regex..

 

i got this code..

<?php $str = '/mem/P/ers/none/x/vV7yiWQN21v6zoHR/9xx33';
$patt = '/[a-zA-Z0-9]{3}/[a-zA-Z0-9]/[a-zA-Z0-9]{3}\/[a-zA-Z0-9]{4}/[a-zA-Z0-9]{16}/';
echo preg_replace($patt,"",$str);
?>

 

I need to cut this url: "/mem/P/ers/none/x/vV7yiWQN21v6zoHR/"--> remove this, "9xx33" get this one:

but its not getting the data the worst is, it cuts nothing..im very sure that the error was in my regex.. please help..

thanx in advance...

Link to comment
https://forums.phpfreaks.com/topic/44316-help-me-new-to-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.