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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.