- Original Message -
From: "David Draley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 24, 2001 8:13 AM
Subject: reg exp match
> How would I print only the words that contain the letter "p" in a file???
> Right now I am only printing the entire lines that contain w
--- David Draley <[EMAIL PROTECTED]> wrote:
> How would I print only the words that contain the letter "p" in a file???
> Right now I am only printing the entire lines that contain words with the
> letter "p".
>
> while ()
> {
> if(/[p]/)
>
> while () {
> print if /[.?]$/;
> }
> __DATA__
> This is a test.
> Is this another test?
> This doesn't print!
That character class should have been "[.,?]", since a comma was apparently desired.
Also, the dot, comma, and question mark do not need to be escaped i
> -Original Message-
> From: David Draley [mailto:[EMAIL PROTECTED]]
> Sent: September 20, 2001 12:35
> To: [EMAIL PROTECTED]
> Subject: reg exp
>
> hello -
>
> I am trying to search a for any sentence that ends in "." or "?" I
> want to only print those sentences that end with "." or
thanks.
it seemed to like the [] better.
while ()
{
print "$_" if /[\.\,\?]$/;
}
close(FILE);
>From: "Moon, John" <[EMAIL PROTECTED]>
>To: 'David Draley' <[EMAIL PROTECTED]>
>CC: "
Try
open (FILE, "$file") or die 'Open failed'; # where $file = 'some path
and/or file name'
while () {
print "$_" if /\.\?$/; # the only the last character of the
line is a <.,?> !
}
hope this give you some ideas ...
-Original Message-
From: David Draley [m
I've got this working nicely now. The data was being called by
ENV('QUERY_STRING'), which was causing most of the troubles.
Thank you very much to Michael and Bradley for their help
Cheers
Di
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> From your example, it appears that you simply need to parse a
> URL-encoded
> string. For that, you could use this regex, which uses the chr and hex
> functions to translate URL-encoded characters:
>
> $string =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
Is this better than
$string =~ s/%(..
On 8/8/01 7:08 PM, Dianne Van Dulken wrote:
> Hi All,
>
> I am having a little trouble with a regexp and I was hoping I might get a
> hint towards a module or something like that.
>
> I get a query string passed to me, that I need to record in a database. A
> typical one might look like this: