Eggzorcist Posted November 6, 2010 Share Posted November 6, 2010 Is it possible using the limiters {} to show only the minimum requirement with no maximum requirement. if(filter_var($message, FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>"/{7}/"))) === false){ echo $error['message'] = "ERROR"; } I get an error with this, and without the backslashes too... Any other ways? Thanks! Link to comment https://forums.phpfreaks.com/topic/217949-simple-regex-expression/ Share on other sites More sharing options...
.josh Posted November 6, 2010 Share Posted November 6, 2010 {...} is a range quantifier. Example: {n} n occurrences exactly {n,} At least n occurrences {,m} At most m occurrences {n,m} Between n and m occurrences What your pattern says is..."match exactly 7 of...." except you aren't actually matching for anything in that pattern. Please explain what it is you are actually trying to match. Link to comment https://forums.phpfreaks.com/topic/217949-simple-regex-expression/#findComment-1131157 Share on other sites More sharing options...
Eggzorcist Posted November 6, 2010 Author Share Posted November 6, 2010 I've actually solved this problem. Thanks! Link to comment https://forums.phpfreaks.com/topic/217949-simple-regex-expression/#findComment-1131162 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.