-3

string should not be longer than 26 alphanumeric characters string should not begin with www OR api OR admin string may contain hyphens

I have this regular expression that works:

^(?!www)(?!admin)(?!api)[a-zA-Z0-9.]{1,26}

Can you help me convert that regex into a java style string regex?

Becks
  • 1,299
  • 4
  • 28
  • 46

1 Answers1

-1

I found the answer by changing my regex to the following:

^(www|api|admin)\w{1,26}$
John Moutafis
  • 20,172
  • 8
  • 64
  • 108
Becks
  • 1,299
  • 4
  • 28
  • 46