Lazaaa Lazaaa - 2 months ago 10
PHP Question

Regex number of spaces

I have a strings "Peugeot 208 1.6HDi192 TGK Confort" or "Renault Clio III 1.5DCi75 AC-Tem" but i need only "Peugeot 208 1.6HDi192" and "Renault Clio III 1.5DCi75".
I need know number of spaces cc99 or cc999 (c=character).

Ty for help.

Answer

Assuming that each car fits the same type of formatting, this expression would work for you:

(.*?\d\.\d[A-Za-z]{3}\d+)

Comments