I am learning regex and I am testing some string lookup/replacement on the user agent.
I have few user agent with:
- .NET CLR 11432
- .NET CLR 2.0.2648
- .NET CLR 1.0.1369
- .NET CLR 2.0.90283
I can replace the ".net clr \d" but it does no work properly.
$ua = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 4.1; .NET CLR 12858)';
$r = preg_replace('/.NET CLR \d/i', '', $ua);
var_dump($r);
and i get:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 4.1; 2858; .0.6143)
clearly i am missing something, but what?
thanks