in reply to Re: Counting frequency of expressions in a string
in thread Counting frequency of expressions in a string
/\b(\d{2})-(\d{2})-(\d{4})\sPerl\sParty/gsYou don't have any dots in this regexp, so the /s is useless. You might feel like I'm nitpicking, and I am: I wouldn't mind its presence in actual production code.
But this is a site for earning learning, you shouldn't set a bad example, too many people are cargo culting code (especially regular expressions) from this site already, so I think we should releave the code we post here from any voodoo as much as possible, so people will actually begin to understand the code they're copying.
Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Counting frequency of expressions in a string
by holli (Abbot) on Aug 29, 2005 at 10:33 UTC | |
|
Re^3: Counting frequency of expressions in a string
by GrandFather (Saint) on Aug 29, 2005 at 11:28 UTC |