Re: Regular Expression Question
| From: | Andrei BEJENARU | Date: | Fri, 21 Nov 2003 15:49:36 +0000 |
| Subject: | Re: Regular Expression Question | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-22157@lists.php.net to get a copy of this message | ||
Enclose a capturing group (\d) and the use prefix\${1} inside the
replacement.
Check out the PHP manual:
$string = "April 15, 2003";
$pattern = "/(\w+) (\d+), (\d+)/i";
$replacement = "\${1}1,\$3";
"Gerardo Rojas" <grojas@strategicinc.com> wrote in message
news:F0EDCD6B96C14741A2F6B0BE6EB7D9CF6D703B@scsprdm.strategicinc.com...
I have a regular expression, that finds what i want. The problem lies in
that I don't want to replace this pattern with another. I want to prefix
the pattern with a character. Any suggestions as to how I might accomplish
this?
regular expression = '/^\d\{1,2}\./'
--
Gerardo S. Rojas
mailto: grojas@strategicinc.com