I want to match either @ or 'at' in a regex. Can someone help? I tried using the ? operator, giving me /@?(at)?/ but that didn't work
Try:
/(@|at)/
This means either @ or at but not both. It's also captured in a group, so you can later access the exact match through a backreference if you want to.
@
at
1.4m articles
1.4m replys
5 comments
57.0k users