kdsxchris Posted June 2, 2007 Share Posted June 2, 2007 When I used the following code I got the following error: echo preg_match ('[a-z]{2,6}', 'ccc'); Warning: preg_match() [function.preg-match]: Unknown modifier '{' in file on line 3 If I used the ereg function, I get no error the results I want. Does PCRE not allow the { quantifier thing? PHP version 4.4.7 Link to comment https://forums.phpfreaks.com/topic/53960-preg_match/ Share on other sites More sharing options...
Orio Posted June 2, 2007 Share Posted June 2, 2007 Try: echo preg_match ('/[a-z]{2,6}/', 'ccc'); Orio. Link to comment https://forums.phpfreaks.com/topic/53960-preg_match/#findComment-266762 Share on other sites More sharing options...
kdsxchris Posted June 2, 2007 Author Share Posted June 2, 2007 I had the same problem with javascript just today and the fix was almost the exact same thing. I'm just used to java regex methods too much I guess... Thanks. Link to comment https://forums.phpfreaks.com/topic/53960-preg_match/#findComment-266766 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.