Re: [PHP] Regular expression to find from start of string to first space [SOLVED]

2006-08-08 Thread Dave M G
Richard, Adam, Barry, Dave, David, Thank you all for your helpful advice regarding expressions. I was able to combine all your advice, and made some additional discoveries along the way. The winning expression is: "#^(.*)\s#iU" First, I discovered that sometimes the source text had an unexpe

Re: [PHP] Regular expression to find from start of string to first space

2006-08-08 Thread Richard Lynch
On Tue, August 8, 2006 4:21 am, Dave M G wrote: > Shouldn't this regular expression select everything from the start of > the string to the first space character: > > $firstWord = preg_match('#^*(.*) #iU', $word); > > It doesn't, so clearly I'm wrong, but here's why I thought it would: > > The encl

Re: [PHP] Regular expression to find from start of string to first space

2006-08-08 Thread Dave Goodchild
On 08/08/06, Dave M G <[EMAIL PROTECTED]> wrote: PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: . stands fo

Re: [PHP] Regular expression to find from start of string to first space

2006-08-08 Thread David Tulloh
Dave M G wrote: > PHP, > > Shouldn't this regular expression select everything from the start of > the string to the first space character: > > $firstWord = preg_match('#^*(.*) #iU', $word); > > It doesn't, so clearly I'm wrong, but here's why I thought it would: > > The enclosing has marks, "#

[PHP] Regular expression to find from start of string to first space

2006-08-08 Thread Dave M G
PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing has marks, "#", I *think* just encloses the ex