<?php $strings = [ "123A.478", "123.48", "123AX", "--123.46", "123A-.46", "-123--.46", "A-123-.46" ]; $pattern = '/^[^\d\s]+(?=-)|[^\d\s.]+(?!\d)/'; foreach ($strings as $str) { echo preg_replace($pattern, "", $str) . PHP_EOL; }
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`