[29492] in Perl-Users-Digest
Perl-Users Digest, Issue: 736 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 9 16:14:37 2007
Date: Thu, 9 Aug 2007 13:14:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 9 Aug 2007 Volume: 11 Number: 736
Today's topics:
Re: Need help in writing PCRE <invalid@invalid.org>
Re: Need help in writing PCRE <glex_no-spam@qwest-spam-no.invalid>
Re: Need help in writing PCRE <vikrant.kansal@gmail.com>
Re: Need help in writing PCRE <bpatton@ti.com>
Re: Need help in writing PCRE <invalid@invalid.org>
Re: Need help in writing PCRE <vikrant.kansal@gmail.com>
Re: Need help in writing PCRE <vikrant.kansal@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 09 Aug 2007 20:23:00 +0200
From: David Sudlow <invalid@invalid.org>
Subject: Re: Need help in writing PCRE
Message-Id: <46bb5b8e$0$27368$ba4acef3@news.orange.fr>
vikrant wrote:
> On Aug 9, 10:26 pm, David Sudlow <inva...@invalid.org> wrote:
>> vikrant wrote:
>>> Hi everyone,
>>> I know this not the right place to ask this question but i did not
>>> found any group specific for discussion problem related to PCRE. But,
>>> i believe members of this forum are having good in writing PCRE thats
>>> why i am posting my question here.
>>> I need ur help in writing the pcre for the following string
>>> string :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
>>> Now, what i need to match is "ftp:" "anything in between except i.e
>>> ^(%00)" followed by "%00" then Dot
>>> What i have tried so far is
>>> 1. /ftp:.*%00./i but .* match any thing including %00 (except
>>> newline)
>>> 2. /ftp:(^\%00)*./i It's not working.
>>> 3. /ftp:^(%00)*./i It's not working.
>>> The problem is ignore any character till particular string i.e "%00"
>>> not come.
>>> So,please help me out.
>>> Regards,
>>> Vikrant
>> 1. was pretty close but you forgot to escape the literal .
>> try
>> /ftp:.*%00\./i
>
> Hi David,
>
> Thanks for the reply.You are right i forgot this but my problem is
> still persist because the problem occurring in .*
>
> /ftp:.*%00\./i
>
> here this pcre first matches "ftp:" then "any thing including %00
> (except newline) because of .* " which i don't want.I want it to match
> anything till it'll not find any "%00" then match DOT
>
> Please correct me if i am wrong.
>
> Regards,
> Vikrant
>
That doesn't make a lot of sense to me.
Can you supply some examples of what you want to match and not match?
Does the expression given match the one example you gave in the language
you are using or not? (it would in perl).
Could you let us know exactly which regex engine you are using?
------------------------------
Date: Thu, 09 Aug 2007 13:28:08 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Need help in writing PCRE
Message-Id: <46bb5cb9$0$509$815e3792@news.qwest.net>
vikrant wrote:
> On Aug 9, 10:26 pm, David Sudlow <inva...@invalid.org> wrote:
>> vikrant wrote:
>>> Hi everyone,
>>> I know this not the right place to ask this question but i did not
>>> found any group specific for discussion problem related to PCRE. But,
>>> i believe members of this forum are having good in writing PCRE thats
>>> why i am posting my question here.
>>> I need ur help in writing the pcre for the following string
>>> string :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
>>> Now, what i need to match is "ftp:" "anything in between except i.e
>>> ^(%00)" followed by "%00" then Dot
>>> What i have tried so far is
>>> 1. /ftp:.*%00./i but .* match any thing including %00 (except
>>> newline)
>>> 2. /ftp:(^\%00)*./i It's not working.
>>> 3. /ftp:^(%00)*./i It's not working.
>>> The problem is ignore any character till particular string i.e "%00"
>>> not come.
>>> So,please help me out.
>>> Regards,
>>> Vikrant
>> 1. was pretty close but you forgot to escape the literal .
>> try
>> /ftp:.*%00\./i
>
> Hi David,
>
> Thanks for the reply.You are right i forgot this but my problem is
> still persist because the problem occurring in .*
>
> /ftp:.*%00\./i
>
> here this pcre first matches "ftp:" then "any thing including %00
> (except newline) because of .* " which i don't want.I want it to match
> anything till it'll not find any "%00" then match DOT
>
> Please correct me if i am wrong.
>
> Regards,
> Vikrant
>
/ftp:.*(?=%00\.)/
------------------------------
Date: Thu, 09 Aug 2007 11:56:31 -0700
From: vikrant <vikrant.kansal@gmail.com>
Subject: Re: Need help in writing PCRE
Message-Id: <1186685791.102999.57530@e16g2000pri.googlegroups.com>
On Aug 9, 11:23 pm, David Sudlow <inva...@invalid.org> wrote:
> vikrant wrote:
> > On Aug 9, 10:26 pm, David Sudlow <inva...@invalid.org> wrote:
> >> vikrant wrote:
> >>> Hi everyone,
> >>> I know this not the right place to ask this question but i did not
> >>> found any group specific for discussion problem related to PCRE. But,
> >>> i believe members of this forum are having good in writing PCRE thats
> >>> why i am posting my question here.
> >>> I need ur help in writing the pcre for the following string
> >>> string :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
> >>> Now, what i need to match is "ftp:" "anything in between except i.e
> >>> ^(%00)" followed by "%00" then Dot
> >>> What i have tried so far is
> >>> 1. /ftp:.*%00./i but .* match any thing including %00 (except
> >>> newline)
> >>> 2. /ftp:(^\%00)*./i It's not working.
> >>> 3. /ftp:^(%00)*./i It's not working.
> >>> The problem is ignore any character till particular string i.e "%00"
> >>> not come.
> >>> So,please help me out.
> >>> Regards,
> >>> Vikrant
> >> 1. was pretty close but you forgot to escape the literal .
> >> try
> >> /ftp:.*%00\./i
>
> > Hi David,
>
> > Thanks for the reply.You are right i forgot this but my problem is
> > still persist because the problem occurring in .*
>
> > /ftp:.*%00\./i
>
> > here this pcre first matches "ftp:" then "any thing including %00
> > (except newline) because of .* " which i don't want.I want it to match
> > anything till it'll not find any "%00" then match DOT
>
> > Please correct me if i am wrong.
>
> > Regards,
> > Vikrant
>
> That doesn't make a lot of sense to me.
>
> Can you supply some examples of what you want to match and not match?
>
> Does the expression given match the one example you gave in the language
> you are using or not? (it would in perl).
>
> Could you let us know exactly which regex engine you are using?
For Example:-
String :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
Match :- ftp:\\abnssjs%20jfdhjdh.htc%00. (What i want)
String :- ftp:\\abnssjs%20jfdhjdh.ads%00.htc%00.exe
Match :- ftp:\\abnssjs%20jfdhjdh.ads%00. (What i want)
I am trying this on application supporting pcre library of http://www.pcre.org/
Regards,
Vikrant
------------------------------
Date: Thu, 09 Aug 2007 12:04:07 -0500
From: Billy Patton <bpatton@ti.com>
Subject: Re: Need help in writing PCRE
Message-Id: <f9fhe8$jjs$1@home.itg.ti.com>
vikrant wrote:
> Hi everyone,
>
> I know this not the right place to ask this question but i did not
> found any group specific for discussion problem related to PCRE. But,
> i believe members of this forum are having good in writing PCRE thats
> why i am posting my question here.
>
> I need ur help in writing the pcre for the following string
>
> string :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
>
> Now, what i need to match is "ftp:" "anything in between except i.e
> ^(%00)" followed by "%00" then Dot
>
> What i have tried so far is
>
> 1. /ftp:.*%00./i but .* match any thing including %00 (except
> newline)
> 2. /ftp:(^\%00)*./i It's not working.
> 3. /ftp:^(%00)*./i It's not working.
>
> The problem is ignore any character till particular string i.e "%00"
> not come.
>
> So,please help me out.
>
> Regards,
> Vikrant
>
Try using Regex Coach
Best regular expression tool I have ever found
http://weitz.de/regex-coach/
------------------------------
Date: Thu, 09 Aug 2007 21:13:57 +0200
From: David Sudlow <invalid@invalid.org>
Subject: Re: Need help in writing PCRE
Message-Id: <46bb677f$0$25946$ba4acef3@news.orange.fr>
vikrant wrote:
> On Aug 9, 11:23 pm, David Sudlow <inva...@invalid.org> wrote:
>> vikrant wrote:
>>> On Aug 9, 10:26 pm, David Sudlow <inva...@invalid.org> wrote:
>>>> vikrant wrote:
>>>>> Hi everyone,
>>>>> I know this not the right place to ask this question but i did not
>>>>> found any group specific for discussion problem related to PCRE. But,
>>>>> i believe members of this forum are having good in writing PCRE thats
>>>>> why i am posting my question here.
>>>>> I need ur help in writing the pcre for the following string
>>>>> string :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
>>>>> Now, what i need to match is "ftp:" "anything in between except i.e
>>>>> ^(%00)" followed by "%00" then Dot
>>>>> What i have tried so far is
>>>>> 1. /ftp:.*%00./i but .* match any thing including %00 (except
>>>>> newline)
>>>>> 2. /ftp:(^\%00)*./i It's not working.
>>>>> 3. /ftp:^(%00)*./i It's not working.
>>>>> The problem is ignore any character till particular string i.e "%00"
>>>>> not come.
>>>>> So,please help me out.
>>>>> Regards,
>>>>> Vikrant
>>>> 1. was pretty close but you forgot to escape the literal .
>>>> try
>>>> /ftp:.*%00\./i
>>> Hi David,
>>> Thanks for the reply.You are right i forgot this but my problem is
>>> still persist because the problem occurring in .*
>>> /ftp:.*%00\./i
>>> here this pcre first matches "ftp:" then "any thing including %00
>>> (except newline) because of .* " which i don't want.I want it to match
>>> anything till it'll not find any "%00" then match DOT
>>> Please correct me if i am wrong.
>>> Regards,
>>> Vikrant
>> That doesn't make a lot of sense to me.
>>
>> Can you supply some examples of what you want to match and not match?
>>
>> Does the expression given match the one example you gave in the language
>> you are using or not? (it would in perl).
>>
>> Could you let us know exactly which regex engine you are using?
>
> For Example:-
>
> String :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
> Match :- ftp:\\abnssjs%20jfdhjdh.htc%00. (What i want)
>
> String :- ftp:\\abnssjs%20jfdhjdh.ads%00.htc%00.exe
> Match :- ftp:\\abnssjs%20jfdhjdh.ads%00. (What i want)
>
> I am trying this on application supporting pcre library of http://www.pcre.org/
>
> Regards,
> Vikrant
>
>
OK in perl you would specify lazy matching:
/ftp:.*?%00\./
and if you want to capture what matches (rather than just affirm a match):
/(ftp:.*?%00\.)/
------------------------------
Date: Thu, 09 Aug 2007 12:23:43 -0700
From: vikrant <vikrant.kansal@gmail.com>
Subject: Re: Need help in writing PCRE
Message-Id: <1186687423.609985.79090@d30g2000prg.googlegroups.com>
On Aug 9, 10:04 pm, Billy Patton <bpat...@ti.com> wrote:
> vikrant wrote:
> > Hi everyone,
>
> > I know this not the right place to ask this question but i did not
> > found any group specific for discussion problem related to PCRE. But,
> > i believe members of this forum are having good in writing PCRE thats
> > why i am posting my question here.
>
> > I need ur help in writing the pcre for the following string
>
> > string :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
>
> > Now, what i need to match is "ftp:" "anything in between except i.e
> > ^(%00)" followed by "%00" then Dot
>
> > What i have tried so far is
>
> > 1. /ftp:.*%00./i but .* match any thing including %00 (except
> > newline)
> > 2. /ftp:(^\%00)*./i It's not working.
> > 3. /ftp:^(%00)*./i It's not working.
>
> > The problem is ignore any character till particular string i.e "%00"
> > not come.
>
> > So,please help me out.
>
> > Regards,
> > Vikrant
>
> Try using Regex Coach
> Best regular expression tool I have ever foundhttp://weitz.de/regex-coach/
Thanks for the suggestion.I am already using it.But,i preferred Regex
Buddy over Regex coach if it is free.
------------------------------
Date: Thu, 09 Aug 2007 12:28:08 -0700
From: vikrant <vikrant.kansal@gmail.com>
Subject: Re: Need help in writing PCRE
Message-Id: <1186687688.295482.126140@e16g2000pri.googlegroups.com>
On Aug 10, 12:13 am, David Sudlow <inva...@invalid.org> wrote:
> vikrant wrote:
> > On Aug 9, 11:23 pm, David Sudlow <inva...@invalid.org> wrote:
> >> vikrant wrote:
> >>> On Aug 9, 10:26 pm, David Sudlow <inva...@invalid.org> wrote:
> >>>> vikrant wrote:
> >>>>> Hi everyone,
> >>>>> I know this not the right place to ask this question but i did not
> >>>>> found any group specific for discussion problem related to PCRE. But,
> >>>>> i believe members of this forum are having good in writing PCRE thats
> >>>>> why i am posting my question here.
> >>>>> I need ur help in writing the pcre for the following string
> >>>>> string :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
> >>>>> Now, what i need to match is "ftp:" "anything in between except i.e
> >>>>> ^(%00)" followed by "%00" then Dot
> >>>>> What i have tried so far is
> >>>>> 1. /ftp:.*%00./i but .* match any thing including %00 (except
> >>>>> newline)
> >>>>> 2. /ftp:(^\%00)*./i It's not working.
> >>>>> 3. /ftp:^(%00)*./i It's not working.
> >>>>> The problem is ignore any character till particular string i.e "%00"
> >>>>> not come.
> >>>>> So,please help me out.
> >>>>> Regards,
> >>>>> Vikrant
> >>>> 1. was pretty close but you forgot to escape the literal .
> >>>> try
> >>>> /ftp:.*%00\./i
> >>> Hi David,
> >>> Thanks for the reply.You are right i forgot this but my problem is
> >>> still persist because the problem occurring in .*
> >>> /ftp:.*%00\./i
> >>> here this pcre first matches "ftp:" then "any thing including %00
> >>> (except newline) because of .* " which i don't want.I want it to match
> >>> anything till it'll not find any "%00" then match DOT
> >>> Please correct me if i am wrong.
> >>> Regards,
> >>> Vikrant
> >> That doesn't make a lot of sense to me.
>
> >> Can you supply some examples of what you want to match and not match?
>
> >> Does the expression given match the one example you gave in the language
> >> you are using or not? (it would in perl).
>
> >> Could you let us know exactly which regex engine you are using?
>
> > For Example:-
>
> > String :- ftp:\\abnssjs%20jfdhjdh.htc%00.mnd
> > Match :- ftp:\\abnssjs%20jfdhjdh.htc%00. (What i want)
>
> > String :- ftp:\\abnssjs%20jfdhjdh.ads%00.htc%00.exe
> > Match :- ftp:\\abnssjs%20jfdhjdh.ads%00. (What i want)
>
> > I am trying this on application supporting pcre library ofhttp://www.pcre.org/
>
> > Regards,
> > Vikrant
>
> OK in perl you would specify lazy matching:
> /ftp:.*?%00\./
>
> and if you want to capture what matches (rather than just affirm a match):
> /(ftp:.*?%00\.)/
Thanks for the help.Now it's works well for second case also.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 736
**************************************