slough Posted May 15, 2008 Share Posted May 15, 2008 As topic says... I need regex that matches the following urls /node/12345 /node/123 But NOT /node/12345/edit /node/123/edit How do I fix this...? Link to comment https://forums.phpfreaks.com/topic/105711-match-node12345-but-not-node12345edit/ Share on other sites More sharing options...
effigy Posted May 15, 2008 Share Posted May 15, 2008 #/node/\d+(?!/edit)# If the number comes last in the string, use \z in place of (?!/edit). Link to comment https://forums.phpfreaks.com/topic/105711-match-node12345-but-not-node12345edit/#findComment-541839 Share on other sites More sharing options...
slough Posted May 19, 2008 Author Share Posted May 19, 2008 Thanks a lot! It worked with \z in the end. Solved! Link to comment https://forums.phpfreaks.com/topic/105711-match-node12345-but-not-node12345edit/#findComment-544833 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.