Re: [wdvltalk] Regular Expressions in PHP

2007-10-25 Thread Portman
I am not that familiar with PHP, but try using [0-9][0-9]-[0-9][0-9] HTH, Riva Ross Clutterbuck wrote: Hi all After many years of head-scratching trying to get to grips with Regular Expressions, I've come to a point in a project where I must utilise their power but I'm hitting brick walls

Re: [wdvltalk] Regular Expressions in PHP

2007-10-25 Thread David Blakey
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

Re: [wdvltalk] Regular Expressions in PHP

2007-10-25 Thread David Blakey
Oops. ^[0-9]+-^[0-9]+ • 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: wdvltalk@lists.wdvl.com To change subscription

RE: [wdvltalk] Regular Expressions in PHP

2007-10-25 Thread Dan Parry
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

Re: [wdvltalk] Regular Expressions in PHP

2007-10-25 Thread Sheila Fenelon
Dan Parry wrote: 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 :) Just to 'splain that a little ... $string = '47-73'; $pattern = '/([0-9]+)(-)([0-9]+)/';

Re: [wdvltalk] Regular Expressions in PHP

2007-10-25 Thread Ross Clutterbuck
Thanks Dan and Sheila Now that I see where you're coming from I should be able to adapt it to match a lot of the other things I want to change. No doubt I'll be back when I hit problems! MOU � The WDVL Discussion List from WDVL.COM � To Join wdvltalk, Send An Email To: