There is a line xxxxxxxxx 10.12.2012 xxxxxx.
You must delete everything from the date
preg_replace("/([0-2]\d|3[01])\.(0\d|1[012])\.(\d{1,4})$/", " ",$pass_agensy);
Tell me, please, what is the error?
There is a line xxxxxxxxx 10.12.2012 xxxxxx.
You must delete everything from the date
preg_replace("/([0-2]\d|3[01])\.(0\d|1[012])\.(\d{1,4})$/", " ",$pass_agensy);
Tell me, please, what is the error?
Sorry. I did not understand that the American format. You just have the wrong grouping.
(?:[0-2]\d)|(?:3[01])\.(?:0\d)|(?:1[012])\.(\d{1,4})
/\d+.+(.*)/
- PalmervanAnd if without a regular expression? You can take part of your line before the first space:
<?php $st = 'xxxxxxxxx 10.12.2012 xxxxxx'; $st = substr($st, 0, strpos($st, ' ')); // $st = 'xxxxxxxxx' ?>
Source: https://ru.stackoverflow.com/questions/138716/
All Articles