Michan Posted March 3, 2008 Share Posted March 3, 2008 Hi everyone, I'm trying to select any url that does not consist of a "\" (backslash), "mail", "ftp", or "www". This is what I have: ([^/|(www|ftp|mail)]+) However, that blocks out any urls that contain the letters "w", "f", "t", "p", "m", "a", "i", and "l". Other urls work fine. How should this expression look if I want to block the whole words rather than the letters of them? Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/94106-regular-expressions-finding-a-pattern-that-does-not-consist-of-xyz/ Share on other sites More sharing options...
teng84 Posted March 3, 2008 Share Posted March 3, 2008 im not good at regex but try $string = 'www'; if (eregi('((www)|(ftp)|(mail))', $string)) { echo "'$string'"; } Link to comment https://forums.phpfreaks.com/topic/94106-regular-expressions-finding-a-pattern-that-does-not-consist-of-xyz/#findComment-482072 Share on other sites More sharing options...
dsaba Posted March 4, 2008 Share Posted March 4, 2008 I had a great reply but phpfreaks keeps giving me this error msg, so I can't post it: Method Not Implemented POST to /forums/index.php not supported. Apache/2.2.0 (Linux) Server at www.phpfreaks.com Port 80 Link to comment https://forums.phpfreaks.com/topic/94106-regular-expressions-finding-a-pattern-that-does-not-consist-of-xyz/#findComment-482598 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.