Joseph Discenza graced perl with these words of wisdom:
> I haven't seen anyone recommend this: /T.*T/i to match two 'T's. I'm not
> going to compare this to $Bill's word-matching routine :).
That's such a simple solution, and it seems to work. In a previous post,
I wrote:
> As an example, sup
Ted Schuerzinger wrote, on Saturday, November 06, 2004 3:29 PM
: I'm an avid, but not very good, Scrabble player. Last night, I was
: playing, and suffered a major brain cramp when I got a rack
: of four vowels
: *and* two blanks: AEIUR**. I couldn't come up with anything
: at the time
$Bill Luebkert graced perl with these words of wisdom:
> Outer:
Hmm I don't understand what the lines "Outer:" and "next Outer;" do.
> while () {
> if (/^[a-z]{7}$/i) {
>
> my $word = $_;
> foreach (qw(a e r s t t t)) {
>if (not $word =~ s/$_//i) {
Glenn Linderman graced perl with these words of wisdom:
> Maybe Ted doesn't care about the performance of repeated similar
> queries. Depends on if he's "cheating in real time", or just
> occasionally wants to check a word. But he did mention the word
> "efficient" in the original posting.
N
Glenn Linderman wrote:
> It looks like you're assuming the 8th letter must be at the beginning or
> end of the 7 letters on the rack. However, depending on the open space
> on the board, the 8th letter (already on the board) could really be
> placed at any position in the resulting 8 letter wo
Glenn Linderman wrote:
> On approximately 11/6/2004 8:48 PM, came the following characters from
> the keyboard of $Bill Luebkert:
>
>>Glenn Linderman wrote:
>>
>>
>>
>>>Let's say you had AERSTTT in your rack (yep, that's the thing that
>>>holds the tiles). Now, clearly that matches the wor
Ted Schuerzinger wrote:
> $Bill Luebkert graced perl with these words of wisdom:
>
>
>>Ted Schuerzinger wrote:
>>
>>
>>>I'm an avid, but not very good, Scrabble player. Last night, I was
>>>playing, and suffered a major brain cramp when I got a rack of four
>>>vowels *and* two blanks: AEIUR*
Glenn Linderman wrote:
> Let's say you had AERSTTT in your rack (yep, that's the thing that
> holds the tiles). Now, clearly that matches the word "tatters". But
> how would you make the regex that finds it, but doesn't find "batters",
> "matters", "hatters", "patters", and even "praters"
$Bill Luebkert graced perl with these words of wisdom:
> Ted Schuerzinger wrote:
>
>> I'm an avid, but not very good, Scrabble player. Last night, I was
>> playing, and suffered a major brain cramp when I got a rack of four
>> vowels *and* two blanks: AEIUR**. I couldn't come up with anythin
Ted Schuerzinger wrote:
> I'm an avid, but not very good, Scrabble player. Last night, I was
> playing, and suffered a major brain cramp when I got a rack of four vowels
> *and* two blanks: AEIUR**. I couldn't come up with anything at the time,
> so this morning wrote a simple Perl script
Thomas, Mark - BLS CTR graced perl with these words of wisdom:
> For the letter-substitution matches, why not create mini-re for each
> one?
>
> $a = qr/[EMAIL PROTECTED]/;
> $i = qr/[i1l\|]/;
>
> $str = "v|agr@";
>
> if ($str =~ /v${i}${a}gr${a}/) {
> #it's spam
> }
>
Because Hamster d
Mark Thomas wrote:
>
> > (i|1|l|\|) to kill the vertical pipe, but I find that much
> > harder to read and more difficult to extend later on.
>
> For the letter-substitution matches, why not create mini-re for each one?
>
> $a = qr/[EMAIL PROTECTED]/;
> $i = qr/[i1l\|]/;
>
> $str = "v|agr@";
>
> (i|1|l|\|) to kill the vertical pipe, but I find that much
> harder to read and more difficult to extend later on.
For the letter-substitution matches, why not create mini-re for each one?
$a = qr/[EMAIL PROTECTED]/;
$i = qr/[i1l\|]/;
$str = "v|agr@";
if ($str =~ /v${i}${a}gr${a}/) {
You can use matching like this ...
if ($stringToSplit =~ /Cat/) {
print "found the string\n";
}
[EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
10/20/2003 09:49 AM
To: [EMAIL PROTECTED]
cc:
Subject: Regex question.
Hi *,
On Thu, 6 Feb 2003, Richard Morse wrote:
> On 02/06/2003 2:09 PM, "Ben Gonzalez" <[EMAIL PROTECTED]> wrote:
>
> > All,
> >
> > I have a string that can contain any number from 0 to 1048575.
> >
> > I can verify that the numbers are digits like this: ^\d{1,7}$
> >
> > The above regex matches any 1
On Thu, 6 Feb 2003, Ben Gonzalez wrote:
> All,
>
> I have a string that can contain any number from 0 to 1048575.
>
> I can verify that the numbers are digits like this: ^\d{1,7}$
>
> The above regex matches any 1 to 7 digits. It will ensure that the string
> contains digits 0 to 999.
>
> I ne
Lee Goddard wrote:
>
> > Lee Goddard wrote:
> > >
> > > > > I need to split a string at all full-stops '.'
> > > > > unless they are part of a sub-string within quotes.
> > > > >
> > > > > Should I manually loop over the file, setting flags,
> > > > > or can I do this with a regular expression?
>
> Lee Goddard wrote:
> >
> > > > I need to split a string at all full-stops '.'
> > > > unless they are part of a sub-string within quotes.
> > > >
> > > > Should I manually loop over the file, setting flags,
> > > > or can I do this with a regular expression?
> > >
> > > And of course, I need to
Lee Goddard wrote:
>
> > > I need to split a string at all full-stops '.'
> > > unless they are part of a sub-string within quotes.
> > >
> > > Should I manually loop over the file, setting flags,
> > > or can I do this with a regular expression?
> >
> > And of course, I need to have escaped sing
> > I need to split a string at all full-stops '.'
> > unless they are part of a sub-string within quotes.
> >
> > Should I manually loop over the file, setting flags,
> > or can I do this with a regular expression?
>
> And of course, I need to have escaped single-quotes too,
> \'
In other wor
> I need to split a string at all full-stops '.'
> unless they are part of a sub-string within quotes.
>
> Should I manually loop over the file, setting flags,
> or can I do this with a regular expression?
And of course, I need to have escaped single-quotes too,
\'
Thanks in anticipation...
l
> -Original Message-
> From: Lee Goddard [mailto:[EMAIL PROTECTED]]
> Sent: 07 June 2001 11:14
> To: Perl_Users
> Subject: Regex Question: splitting at a point unless part of a quoted
> substring
> I need to split a string at all full-stops '.'
> unless they are part of a sub-string with
"[EMAIL PROTECTED]" wrote:
>
> Hi, how can I rewrite this so it's more efficient? Thanks!!!
>
> -Tha
>
> $s = "13:01:13 HTTP request from FiskNT for
> www.bostonphoenix.com/portal/boston/monday.html; result = 200 OK";
>
> $s =~ m/(\d\d:\d\d).*from (\w+) for (.*\.[a-zA-z]+)\/(.*);/;
> $time = $
-start-
> "[EMAIL PROTECTED]" at05/03/2001 12:44 PM
>Hi, how can I rewrite this so it's more efficient? Thanks!!!
If every log entry is the *same* format...
>$s = "13:01:13 HTTP request from FiskNT for
>www.bostonphoenix.com/portal/boston/monday.html; result = 200 OK";
>$s =~ m/(\d\d:\d
On Thu, 3 May 2001, [EMAIL PROTECTED] wrote:
> Hi, how can I rewrite this so it's more efficient? Thanks!!!
>
>
> $s = "13:01:13 HTTP request from FiskNT for
> www.bostonphoenix.com/portal/boston/monday.html; result = 200 OK";
>
> $s =~ m/(\d\d:\d\d).*from (\w+) for (.*\.[a-zA-z]+)\/(.*);/;
> $ti
($time,$user,$rooturl,$suburl) =~ m/(\d{2}:\d{2}).*from (\w+) for
(.*\.[a-zA-z]+)\/(.*);/;
not a lot better...
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 1:44 PM
To: [EMAIL PROTECTED]
Subject: Regex Question
Hi, how can I rewrite
>I would like a regex to replace leading zeroes in a number. For example, a
>ten-digit number string has 5 leading (leftmost) zeroes. I would like to
>replace each leading zero with a space, i.e. 5 leading zeroes with 5
leading
>spaces. I tried s/^0+/ /g but it replaced all leading zeroes with on
>I would like a regex to replace leading zeroes in a number. For example, a
>ten-digit number string has 5 leading (leftmost) zeroes. I would like to
>replace each leading zero with a space, i.e. 5 leading zeroes with 5
leading
>spaces. I tried s/^0+/ /g but it replaced all leading zeroes with on
28 matches
Mail list logo