- May 2020
-
refrf.shreyasminocha.me refrf.shreyasminocha.me
-
-
www.regextester.com www.regextester.com
-
- Feb 2020
-
-
A combinaison of split(), subString(), removePrefix(), removeSuffix() is usually enough.
Sometimes the following functions are more than enough for your string matching problems
-
- Nov 2019
-
www.msweet.org www.msweet.org
-
- Oct 2019
-
www.analyticsmarket.com www.analyticsmarket.com
-
Really useful page for generating regexes of ip ranges. Note they are missing some parenthesis in places though.
Tags
Annotators
URL
-
- Sep 2019
-
-
- Mar 2019
-
regexr.com regexr.com
-
- Nov 2018
-
www.crossref.org www.crossref.org
-
/^10.\d{4,9}/[-._;()/:A-Z0-9]+$/i
Actually, it'd be better to express this as
/^10.\d{4,9}/[-._;()/:a-zA-Z0-9]+$i
(adding lowercase letters a-z, instead of using the case insensitivity flag "i") to avoid compatibility issues with certain regex parsers
-
- Oct 2018
-
dev.to dev.to
Tags
Annotators
URL
-
- Sep 2018
-
www.discoversdk.com www.discoversdk.com
Tags
Annotators
URL
-
- Jun 2017
-
regex101.com regex101.com
-
cool, it will show how many steps are needed to performce the regex! Greatful for tuning regex for performance
-
Regex kontrolü https://regex101.com/
-
-
www.loggly.com www.loggly.com
-
It will then backtrack from the end until it reaches the first space.
so greedy is evil? since it'll backtrack form the end!
-
The faster you can throw out non-matching input, the fewer cycles you waste
but in log analysis field, almost every line are machted, we'just want to use regex to extract fields inside the line. Is the "the longer the better" still matter?
Tags
Annotators
URL
-
-
www.loggly.com www.loggly.com
-
Character classes Possessive quantifiers (and atomic groups) Lazy quantifiers Anchors and boundaries Optimizing regex order
-
- Apr 2017
-
rust-leipzig.github.io rust-leipzig.github.io
- Nov 2016
-
-
Interesting dive into how string slicing with
String#substring
is implemented in the Dart and V8 VMs and the performance consequences of that. This investigation was prompted by poor performance of a port ofless.js
lexer to Dart vs. the original JS implementation.The article ends with benchmarks showing the cost of trying to match sequences of characters in a lexer using a regex vs. manually.
-
A person with a bit more insight into RegExp features might come up with the following optimization:
Neat trick for matching regular expressions within a string starting at a fixed position using pre-ES6 features:
- Create a regex with the global flag set which matches
pattern|()
where()
is an irrefutable pattern which is guaranteed to match - Set
regex.lastIndex
to the position you want to match at - Use
regex.exec(str)
- Create a regex with the global flag set which matches
-
match can be easily implemented in any modern JavaScript interpreter that supports sticky RegExp flag introduced in ES6:
Notes on how to match a regex starting at a given position in a string, making use of the sticky flag introduced in ES6.
-