I have this JavaScript Regex: /(\.abc$|^abc$|abc\.def$)/i
. I feel like this is extremely redundant and it can be simplified. Here's what I'm trying to accomplish:
- It needs to match .abc
only at the end or only abc
or only abc.def
Edit: I realized I could place $
at the end of the parenthesis and it could become /(\.abc|^abc|abc\.def)$/i
. However, this still seems redundant