DEV Community

Discussion on: RegEx in JavaScript with a cool project 🔥

Collapse
tracygjg profile image
TGJ Gilmore • Edited on

A couple of tips I use when preparing regular expression are.
1, Whenever possible top and tail the expression. Use /^ to start and $/ to end the.
2, Try to replace multi-character patterns + and * with their numeric alternatives {1,N} and {0,N}. It is more characters but more performant and less open to error.
A good learning/test resource is regexr.com/.

Collapse
jaspalsingh1998 profile image
Jaspal Singh Author

Thank you so for the tips mate 😅💜