Here are the best JavaScript Regex libraries for your web application. You can use regex in angular to perform form validation, pattern matching in routing, text parsing and manipulation, data filtering and search and replace operations.
Regex, short for "regular expression," is a pattern-matching tool used in various programming languages, including JavaScript. It allows you to match and manipulate strings of text based on specific patterns. Regex can be used to validate user input, search and replace text, and much more. It is written between two slashes (/pattern/) and can include special characters and metacharacters that represent sets of characters or match specific elements of a string.
We have handpicked the best JavaScript libraries to perform regex pattern matching based on popularity, licensing, and unique features.
xregexp:
- Provides augmented regex beyond what is supported by browsers
- Toolkit for grepping and parsing
- Maintains cross browser compatibility
emoji-regex:
- Used to match all Emoji-only symbols as per the Unicode Standard.
- Offers regular expressions for textual representations of emojis as well.
- It is based on emoji-test-regex-pattern.
emoji-regexby mathiasbynens
A regular expression to match all Emoji-only symbols as per the Unicode Standard.
emoji-regexby mathiasbynens
JavaScript 1514 Version:Current License: Permissive (MIT)
safe-regex:
- Used in Utilities, Regex applications, etc.
- Helps in detecting possibly catastrophic, exponential-time regular expressions.
- Has both false positives and false negatives.
safe-regexby substack
detect possibly catastrophic, exponential-time regular expressions
safe-regexby substack
JavaScript 698 Version:Current License: Others (Non-SPDX)
to-regex-range:
- Used for creating regular expressions to validate numbers, ranges, years, etc.
- Validated against more than 2.78 million test assertions.
- Offers a fast compiler and optimized regex.
to-regex-rangeby micromatch
Pass two numbers, get a regex-compatible source string for matching ranges. Fast compiler, optimized regex, and validated against more than 2.78 million test assertions. Useful for creating regular expressions to validate numbers, ranges, years, etc.
to-regex-rangeby micromatch
JavaScript 97 Version:Current License: Permissive (MIT)
RegExr:
- Used for creating, testing, and learning about Regular Expressions.
- RegExr is a web-based tool for testing and learning regular expressions.
- Provides a user-friendly interface for writing complex regex patterns.
regexrby gskinner
RegExr is a HTML/JS based tool for creating, testing, and learning about Regular Expressions.
regexrby gskinner
JavaScript 9149 Version:3.6.1 License: Strong Copyleft (GPL-3.0)
regex101:
- Used for testing and experimenting with regex patterns.
- It’s an online regex tester and debugger.
- Provides a simple and intuitive interface.
regex101by nedrysoft
A cross platform (macOS, Linux & Windows) unofficial "offline" version of the regex101.com website. Uses the users own database (any qt supported backend - sqlite, mysql, postgresql etc) to store expressions.
regex101by nedrysoft
JavaScript 101 Version:1.0 License: No License
Js-regex:
- Used for functions like matching, extracting, and replacing parts of a string.
- Offer a chainable API for constructing RegExps, written in JavaScript.
- provides a number of convenient functions for working with regex patterns.
js-regexby wyantb
A chainable API for constructing RegExps, written in Javascript
js-regexby wyantb
JavaScript 67 Version:Current License: Permissive (MIT)
issue-regex:
- Used for matching issue references with regular expression.
- Can check expressions such as organization name, repository name, and issue number.
- Returns a RegExp for matching issue references.
issue-regexby sindresorhus
Regular expression for matching issue references
issue-regexby sindresorhus
JavaScript 34 Version:v3.1.0 License: Permissive (MIT)