Of course to target and replace just the dash you could use
preg_replace('/([0-9]+)(-)([0-9]+)/', '$1dash$3', '47-73');
where the word 'dash' is your replacement dash naturally :)
HTH
Dan
> -----Original Message-----
> From: David Blakey [mailto:[EMAIL PROTECTED]
> Sent: 25 October 2007 21:57
> To: [email protected]
> Subject: Re: [wdvltalk] Regular Expressions in PHP
>
> At 09:37 a.m. 26/10/2007, you wrote:
> >I am not that familiar with PHP, but try using [0-9][0-9]-[0-9][0-9]
>
> If the numbers can be more than two digits long, [0-9]+-[0-9]+
>
> Regards,
> David
>
>
> ____ The WDVL Discussion List from WDVL.COM ____
> To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
> dl.sparklist.com or
> use the web interface http://e-
> newsletters.internet.com/discussionlists.html/
> Send Your Posts To: [email protected]
> To change subscription settings, add a password or view the web
> interface:
> http://intm-dl.sparklist.com/read/?forum=wdvltalk
>
> ________________ http://www.wdvl.com _______________________
>
> You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to leave-26343723-
> [EMAIL PROTECTED]
> To unsubscribe via postal mail, please contact us at:
> Jupitermedia Corp.
> Attn: Discussion List Management
> 475 Park Avenue South
> New York, NY 10016
>
> Please include the email address which you have been contacted with.
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.15.8/1089 - Release Date:
> 23/10/2007 19:39
>
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.8/1089 - Release Date: 23/10/2007
19:39
____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.