Release 0.9.4 - Exception changes and groupBy()
This release brings updates in exceptions (namespaces, new detailed exceptions) and a groupBy()
method.
#
ExceptionsIn previous release we renamed SafeRegexException
to PregException
. In this, we're renaming CleanRegexException
to PatternException
. So now, those two general exceptions sync nicely with their base methods:
They both extend RegexException
- base for all exceptions thrown by T-Regx. So that's the first thing.
The second exception update - previously, every exception thrown based on preg_last_error()
method was RuntimePregException
. Now, each error has a dedicated exception, which can be caught separately:
The detailed list of changes is in ChangeLog.md.
groupBy()
#
New method This release also comes with a brand new method - groupBy()
which groups matches by a capturing group (name or index). It can match strings, offsets and also map them with map()
and flatMap()
. Additionally, it can be chained with filter()
to leave out unwanted matches: