-3

I have a sign in form where userid is email id of users or unique id given by us i.e in integer.

So i want regex for that text box to validate email or Id.

Means.

if someone enters

abc@abc.com or 1024 then it is valid

and if someone is entering anything other than email or integer than it should show as invalid.

Thanks...

NetMaster
  • 65
  • 9

1 Answers1

1
^(?:[\w.]+@[\w.]+|\d+)$

You can try this.Though Your requirements are not very clear.See demo.

http://regex101.com/r/zU7dA5/4

vks
  • 67,027
  • 10
  • 91
  • 124