regex - php preg_match_all separated by an optional pattern -
i've string follows pattern "[:it]stringa in italiano[:en]string in english". i'm trying use preg_match_all capture locales , associated strings, ie:
[1] => 'it', [2] => 'en', ... [1] => 'stringa in italiano', [2] => 'string in english' the regex i'm using "/\[:(\w+)](.+?)(?=\[:\w+])/g" (https://regex101.com/r/ez1gt7/400) returns first group of data. i'm doing wrong? thanks.
Comments
Post a Comment