in reply to Assessing the complexity of regular expressions
A few random thoughts that I had some time ago about regex complexity. They are far from comprehensive, and not directly usable to measure complexity in some way (and also very personally biased), but I hope they provide food for thought.
Regexes are made of atoms (an atom is something like foobar or \d), groups (which can either capture or not), alternations and quantifiers.
Regexes are visually rather hard to parse if they have many groups, possibly nested.
For the mental complexity (ie trying to assess what a regex does) you have to note that
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Assessing the complexity of regular expressions
by kyle (Abbot) on Jan 28, 2009 at 17:13 UTC |