- 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
--- 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]/)
>
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]/)
{
print "$_";
> 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
>
print "$_" if /\.\?$/; # the only the last character of the
>line is a <.,?> !
> }
>
>hope this give you some ideas ...
>
>-Original Message-
>From: David Draley [mailto:[EMAIL PROTECTED]]
>Sent: September 20, 2001 12:35
>To: [EMAIL PR
-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 w
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 "?" I am having
trouble with the reg expression syntax...
--
while ()
{
$file=;
if(/\.\?$/){
print "$only_sentences_that_end
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:
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:
%3Cdel_phone%3E%28020%200202%2000202%3C/del_phone%3E
12 matches
Mail list logo