On Wed, August 9, 2006 5:07 am, Dave M G wrote:
> The brackets indicate a sub-expression.
The parens indicate that you want to CAPTURE the matched characters.
Inside of [ ] the parens would be a sub-expression, however.
> First question, why is there an extra backslash before the space
> marker
On Wed, August 9, 2006 1:30 am, Dave M G wrote:
> This regular expression stuff is way tricky.
>
> Thanks to help from this list, I have an expression that will select
> the
> first word of a string, up to the first white space:
> "#^(.*)\s#iU"
>
> But after some consideration, I realized that I wa
Robert,
Thank you for responding.
The extra slashes are to properly escape the backslash character since
you are using double quotes
As I said you may want the following pattern in cases where no space
exists:
'#^([^\s]*)\s?(.*)$#'
Thank you for your detailed explanation. Especially wit
On Wed, 2006-08-09 at 08:11 -0700, Kevin Murphy wrote:
>
> On Aug 8, 2006, at 11:30 PM, Dave M G wrote:
>
> > PHP List,
> >
> > This regular expression stuff is way tricky.
> >
> > Thanks to help from this list, I have an expression that will
> > select the first word of a string, up to the fir
On Aug 8, 2006, at 11:30 PM, Dave M G wrote:
PHP List,
This regular expression stuff is way tricky.
Thanks to help from this list, I have an expression that will
select the first word of a string, up to the first white space:
"#^(.*)\s#iU"
But after some consideration, I realized that I
On Wed, 2006-08-09 at 19:07 +0900, Dave M G wrote:
> Robert,
>
> Thank you for your quick response and helpful advice.
> >> Use preg_match() and pay special attention to the manual as it refers to
> >> the third parameter :) The expression you need follows:
> >>"#^([^\\s]*)\\s(.*)$#U"
>
> Thi
Robert,
Thank you for your quick response and helpful advice.
Use preg_match() and pay special attention to the manual as it refers to
the third parameter :) The expression you need follows:
"#^([^\\s]*)\\s(.*)$#U"
This works perfectly.
I now see that the preg_match() function returns an a
On Wed, 2006-08-09 at 02:57 -0400, Robert Cummings wrote:
> On Wed, 2006-08-09 at 15:30 +0900, Dave M G wrote:
> > PHP List,
> >
> > This regular expression stuff is way tricky.
> >
> > Thanks to help from this list, I have an expression that will select the
> > first word of a string, up to the
On Wed, 2006-08-09 at 15:30 +0900, Dave M G wrote:
> PHP List,
>
> This regular expression stuff is way tricky.
>
> Thanks to help from this list, I have an expression that will select the
> first word of a string, up to the first white space:
> "#^(.*)\s#iU"
>
> But after some consideration, I
PHP List,
This regular expression stuff is way tricky.
Thanks to help from this list, I have an expression that will select the
first word of a string, up to the first white space:
"#^(.*)\s#iU"
But after some consideration, I realized that I wanted to keep both
parts of the original text. T
10 matches
Mail list logo