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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -