Go Back   Forum Care Forums > Development Reference Area > Php Development

Reply
 
LinkBack Thread Tools Display Modes
Re: Re: Re: Re: preg_match() returns false but no documentation why
Old
  (#1)
Jared Farrish
Guest
 
Posts: n/a
Default Re: Re: Re: Re: preg_match() returns false but no documentation why - 06-02-2007, 08:56 PM

> Well, sure. It often appears as .* meaning "none or any number of
> any characters." Use it when you honestly don't care what it matches.


This is what I thought it meant. Your example more than clears it up.

> Say you want to find out if the word "frog" occus in a text followed
> by the word "dog." You could match on:
>
> /\bfrog\b(.*\b)?dog\b/i
>
> / pattern delimiter
> \b word boundary
> frog 1st word
> \b word boundary
>
> ( begin subpattern
> .* zero or any characters
> \b word boundary
> ) end subpattern
> ? zero or one instance of the preceding subpattern
>
> dog 2nd word
> \b word boundary
> / pattern delimiter
> i case-insensitive
>
> This guarantees that both words are bounded by word boundaries and
> allows any number of any characters to occur between them. (There's
> sort of an implicit .* before and after the pattern. Because I
> haven't used ^ and $ to define the beginning and end of the text,
> regex looks for my pattern anywhere in the text.)


Very helpful! I still have questions, but a PHP mailing list probably isn't
the best place.

> >And why is it called full stop?

>
> That's what the 'period' is called in British English.
> http://google.ca/search?q=define%3Afull+stop
>
> In English syntax "period" and "full stop" are synonymous, and the
> RegEx manual is throwing "dot" into the same bag.


That's very confusing to call it 'Full Stop' when it doesn't seem to
actually correlate to the regex meaning it identifies, don't you think?
Maybe to a Brit or someone who understands Commonwealth English would know
(I was aware of what it meant in CE, I just woudn't have imagined to apply
it here, since it looks to be descriptive).

Kind've like an elephant trainer calling her elephant's trunk a boot.

--
Jared Farrish
Intermediate Web Developer
Denton, Tx

Abraham Maslow: "If the only tool you have is a hammer, you tend to see
every problem as a nail." $$

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: [PHP] Re: Re: Re: Re: preg_match() returns false but nodocumentation why
Old
  (#2)
Richard Lynch
Guest
 
Posts: n/a
Default Re: [PHP] Re: Re: Re: Re: preg_match() returns false but nodocumentation why - 06-02-2007, 08:56 PM

On Thu, May 31, 2007 7:26 am, Jared Farrish wrote:
>> That's what the 'period' is called in British English.
>> http://google.ca/search?q=define%3Afull+stop
>>
>> In English syntax "period" and "full stop" are synonymous, and the
>> RegEx manual is throwing "dot" into the same bag.

>
> That's very confusing to call it 'Full Stop' when it doesn't seem to
> actually correlate to the regex meaning it identifies, don't you
> think?
> Maybe to a Brit or someone who understands Commonwealth English would
> know
> (I was aware of what it meant in CE, I just woudn't have imagined to
> apply
> it here, since it looks to be descriptive).
>
> Kind've like an elephant trainer calling her elephant's trunk a boot.


@Brits: So is a comma or semi-colon called a Half Stop :-)

PS
Nitpik: Regex Coach also runs very nicely on Linux, not just Windows,
thank goodness. :-)

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: [PHP] Re: Re: Re: Re: preg_match() returns false but nodocumentation why
Old
  (#3)
Stut
Guest
 
Posts: n/a
Default Re: [PHP] Re: Re: Re: Re: preg_match() returns false but nodocumentation why - 06-02-2007, 08:56 PM

Richard Lynch wrote:
> On Thu, May 31, 2007 7:26 am, Jared Farrish wrote:
>>> That's what the 'period' is called in British English.
>>> http://google.ca/search?q=define%3Afull+stop
>>>
>>> In English syntax "period" and "full stop" are synonymous, and the
>>> RegEx manual is throwing "dot" into the same bag.

>> That's very confusing to call it 'Full Stop' when it doesn't seem to
>> actually correlate to the regex meaning it identifies, don't you
>> think?
>> Maybe to a Brit or someone who understands Commonwealth English would
>> know
>> (I was aware of what it meant in CE, I just woudn't have imagined to
>> apply
>> it here, since it looks to be descriptive).
>>
>> Kind've like an elephant trainer calling her elephant's trunk a boot.

>
> @Brits: So is a comma or semi-colon called a Half Stop :-)


No.

@Americans: What did the letters s and u ever do to you?

-Stut
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Contact Us - Forum Care Forums - Archive - Top