T-Regx icon indicating copy to clipboard operation
T-Regx copied to clipboard

Refactor `TRegx\SafeRegex\preg::match` to `\preg2_match()`

Open danon opened this issue 4 years ago • 3 comments

Currently, documentation states that "you only need to replace preg_ with preg::", but that's not true, since you also need to add the namespace.

We should remove the namesapce so the legacy projects really can be updated without any other change.

Perhaps this change can be only in t-regx/preg, not in t-regx/pattern.

danon avatar Jun 30 '21 16:06 danon

Maybe actually we can rename the methods to preg2_match, preg2_replace(), preg2_match_all().

danon avatar Apr 07 '22 16:04 danon

Or maybe even better, Maybe we could name it treg_match, treg_match_all, treg_replace or treg_replace_callback.

  • preg2_match(), preg2_match_all(), preg2_replace(), preg2_replace_callback(), preg2_grep()
  • pregx_match(), pregx_match_all(), pregx_replace(), pregx_replace_callback(), pregx_grep()
  • tregx_match(), tregx_match_all(), tregx_replace(), tregx_replace_callback(), tregx_grep()
  • treg_match(), treg_match_all(), treg_replace(), treg_replace_callback(), treg_grep()

danon avatar Apr 07 '22 16:04 danon

Should preg2_match() restore support for ancient PHP versions, like 5.6 and 5.3?

Support for it was dropped mainly for the sake of pattern().

danon avatar Apr 19 '22 23:04 danon