Skip to content
Advertisement

Tag: preg-match-all

Regex for splitting apparel sizes

I have the following input (only for example, real input contains much more crazy data) and want to split it by separators like / or , but keep pairs of values. This should be done only, if separator does not occur multiple times, so the result should look like: What I have so far is But this fails for 40/42/44/46/48

Advertisement