-1

I currently have the regex string @"[0-9a-zA-Z].+@.+[0-9a-zA-Z]$" The problem with it is that it requires 2+ characters before and after the "@", so an input like a@a won't be valid, while it should

What I need is a way to do .+? without the "Any character" (?) turning into a lazy quantifier

Krystian
  • 13
  • 4

1 Answers1

0

Try changing + to * after each .

[0-9a-zA-Z].*@.*[0-9a-zA-Z]$

https://regex101.com/r/sNMQsw/3

Jacek Rojek
  • 1,082
  • 8
  • 16