Stringy icon indicating copy to clipboard operation
Stringy copied to clipboard

New method request: match()

Open Munawwar opened this issue 8 years ago • 3 comments

Hi. Started using your library today. It has most things, but lacks one that's pretty useful - a method that returns matches based on a regex pattern (More specifically, returns the matches from a preg_match. Maybe we can also have a matchAll() method corresponding to preg_match_all function).

Munawwar avatar Apr 11 '16 21:04 Munawwar

Def agree. At that point, we need to decide whether or not to expose mb_ereg_match with its quirks and differences to preg_match

danielstjules avatar Dec 22 '16 07:12 danielstjules

I'll let you decide that.

Munawwar avatar Dec 22 '16 16:12 Munawwar

I found this method could be useful. @danielstjules how about exposing both methods: s('whatever')->pregMatches('/[a-b]+/') and s('whatever')->eregMatches('what*') ? as an alias method we might want to expose just s('whatever')->matches('/[a-b]+/') this is where we should see what's more popular ereg_match or preg_match.

ivorobioff avatar Aug 14 '18 13:08 ivorobioff