regex how to match all the strings which character x repeated for 5n times -


how write regex each following case:

  1. match string character x repeated 0 or 5 times,e.g. abc or abcxxxxx pass;

  2. match strings character x repeated 5n times, example: xxxxx,xxxxxxxxxx,xxxxxxxxxxxxxxx... pass

thank remarkable answers!! sorry obscurity of previous question, point how use iteration of regex, say, if want character x repeated 5^n times

i guess want this:

/(?:x{5})*/ example


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -