-   Programming (
-   -   Searching for numeric values in PHP (

TheBeli 04-16-2008 01:00 PM

Searching for numeric values in PHP
........remove please

duryodhan 04-16-2008 01:19 PM

should do it.

I think '

$string = 'input text';
$pattern = '/(\w+) (\d)(\d)(\d+)(\w+)/i';
$replacement = '${1}1337$3$4';
echo preg_replace($pattern, $replacement, $string);

graemef 04-16-2008 06:40 PM

A reverse engineering problem...

We have the answer, but what was the question? ;)

jlinkels 04-16-2008 09:40 PM

Since the answer was not '42', the question was not "What is the meaning of life and everything?"

OTOH, maybe there were more answers to that question, and this might be one of them.


graemef 04-16-2008 11:02 PM

Well I believe that there is overwhelming evidence that the answer is 42 but as we know the answer is never as interesting as the question.

duryodhan 04-17-2008 04:55 AM


he wanted to replace

<text+><digit><digit><more digits><moretext>
<text+><digit><digit>1337<moredigits><more text>

All times are GMT -5. The time now is 12:33 PM.