I need a regular expression for a string with exactly one alphabetic character in it.
For example, it should match:
8*x=16
x+2=2
u329398239823
43044343k43304403
...but not:
xsfdjfefljefe
44434f9434343 f
98(***(*)))(*)(0((-900-87
32233232
/^[^a-z]*([a-z])[^a-z]*$/i
i
for case-insensitive matching.
^
and $
anchors to force the regex to match the entire string.
( )
to capture the letter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With