You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
😎 T-Regx The Dinosaur is really proud to announce its release 0.39.0!
Why PHP programmers tend to not filter arrays by regular expressions? Probably because preg_filter() doesn't filter arrays (it actually replaces, like preg_replace()), and the real function to filter arrays is preg_grep(), but who would know that? Yuk! Hence we're adding Pattern.filter() and Pattern.reject() methods, which accept array, and filter it - leaving of either subjects that match the pattern, or subejcts that don't match the pattern.
Additionally, we noticed that T-Regx users felt obligated to catch library exceptions, when using T-Regx API, but frankly, the intention of the library was never to practice exception-driven-development, so we changed all T-Regx public exceptions to RuntimeException, to emphasise that catching those exceptions isn't necessary.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
😎 T-Regx The Dinosaur is really proud to announce its release
0.39.0
!Why PHP programmers tend to not filter arrays by regular expressions? Probably because
preg_filter()
doesn't filter arrays (it actually replaces, likepreg_replace()
), and the real function to filter arrays ispreg_grep()
, but who would know that? Yuk! Hence we're addingPattern.filter()
andPattern.reject()
methods, which acceptarray
, and filter it - leaving of either subjects that match the pattern, or subejcts that don't match the pattern.Additionally, we noticed that T-Regx users felt obligated to catch library exceptions, when using T-Regx API, but frankly, the intention of the library was never to practice exception-driven-development, so we changed all T-Regx public exceptions to
RuntimeException
, to emphasise that catching those exceptions isn't necessary.The detailed list of changes is in ChangeLog.md.
Pattern.forArray().filter()
. UsePattern.filter()
instead.Pattern.forArray().filterAssoc()
.Pattern.forArray().filterByKeys()
.PatternList.chainedReplace()
toPatternList.replace()
PcrePattern
with delimiter\n
,\v
,\f
,t
didn't throwappropriate
MalformedPatternException
Pattern.filter()
, which filters subjects which match the pattern (exactly like previousPattern.forArray().filter()
).Pattern.reject()
, which filters subjects which do not match the pattern.\RuntimeException
, instead of\Exception
.The detailed list of changes is in ChangeLog.md.
Rawrrrrrrr!
This discussion was created from the release 0.39.0 - Shouldn't all libraries be elegant and beautiful?.
Beta Was this translation helpful? Give feedback.
All reactions