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
  • 26,308
  • 17
  • 56
  • 95
GD_Java
  • 1,359
  • 6
  • 24
  • 42

1 Answers1

0

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

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

GoranLegenda
  • 491
  • 3
  • 9