0

I need a java regex expression which can allow a string containing Alpha Numeric, space, hyphen, aphostophy, &, (), ", min 1 characters and max 100 Characters.

I tried with ^[a-zA-Z -`&(),\"]{1,100}$. But it is returning true in conditions where string contains * or | etc.

Federico klez Culloca
  • 24,336
  • 15
  • 57
  • 93
GD_Java
  • 1,309
  • 5
  • 24
  • 41

1 Answers1

0

You can try it like this: ^[a-zA-Z0-9 \-&(),"]{1,100}$`

Working example: https://regex101.com/r/9nQ2JD/1/

GoranLegenda
  • 343
  • 2
  • 7