-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?

David
  • 1,469
  • 5
  • 33
  • 51

1 Answers1

-1

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

^(www|api|admin)\w{1,26}$
John Moutafis
  • 22,254
  • 11
  • 68
  • 112
David
  • 1,469
  • 5
  • 33
  • 51