1

I need a regex for strings containing letters, numbers and underscores in any order, but may not consist of numbers alone. This far I have:

^[a-zA-Z_]+[0-9]*$

But that won't allow 123hello_ even though it should. Strings that should match:

abc123
123_
_123abc
abc_123
_ABC
123_ABC_

Strings that should not match:

1234
hellö
abc%
Patrick
  • 999
  • 1
  • 9
  • 21

0 Answers0