safe-regex | detect possibly catastrophic , exponential-time regular | Regex library
kandi X-RAY | safe-regex Summary
kandi X-RAY | safe-regex Summary
detect possibly catastrophic, exponential-time regular expressions
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Determines if a variable is a regular expression .
safe-regex Key Features
safe-regex Examples and Code Snippets
Community Discussions
Trending Discussions on safe-regex
QUESTION
I was trying to use the following regex in my JS code to find ~...~
blocks:
ANSWER
Answered 2021-Mar-21 at 08:19Don't put too much trust into these automated checks. They might detect common mistake patterns, but not every warning necessarily means that a regex can run into catastrophic backtracking, and I'd go out on a limb and say that regex are too complex to ever get a definitive answer on that from an automated tool.
The two expressions you show are equivalent, the second one just happens to not trip the wire. I don't think that either is unsafe.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install safe-regex
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page