Regexp needed - \n\n problem

2002-06-11 Thread Brano

Hi all,

I need regexp for this:

original message:
===
hi all,

this is just test
==

I need to extract "this is just test" and everything after that.

it could works like this:
1. look if in the first 5 lines is \n\n
2. if yes, extract everything after \n\n
3. if no, just put original message.

I can't do such a macro :(

it could work for reply template, when original message looks like:
=
David Elliott [DE], on Thursday, June 6, 2002 at 14:48 (+0100) wrote
in [EMAIL PROTECTED]">mid:[EMAIL PROTECTED] :

DE> -BEGIN PGP SIGNED MESSAGE-
DE> Hash: SHA1
DE> ...
=

after reply it could quote only:
=
DE> -BEGIN PGP SIGNED MESSAGE-
DE> Hash: SHA1
DE> ...
=

and not also first 2 lines (so I need not to delete them)

-- 

 --+ +--  +- WEB: www.2ge.skMail: [EMAIL PROTECTED]
+--+ |  - +--IRC: _2ge_ (ircnet)ICQ UIN: 7552083
++==+=+- The Bat! 1.60p on Windows 2000; BN 2195.Service Pack 25.0
Blondes have more fun, Redheads ARE more fun!!!


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regexp needed - \n\n problem

2002-06-11 Thread Brano

Brano [B], on Tuesday, June 11, 2002 at 13:51 (+0200) has on mind in
[EMAIL PROTECTED]">mid:[EMAIL PROTECTED] :

B> I need regexp for this:

question:

works in the bat macros something like this:
[^\n](.*)

?

-- 

 ...m8s, cu l8r, Brano.

[Morehouse College, a producer of strong, proud, black men]


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regexp needed - \n\n problem

2002-06-11 Thread Januk Aggarwal

Hello Brano,

On Tuesday, June 11, 2002 at 13:51 GMT +0200, a creature mimicking
Brano [B] wrote:

> I need to extract "this is just test" and everything after that.

> it could works like this:
> 1. look if in the first 5 lines is \n\n
> 2. if yes, extract everything after \n\n
> 3. if no, just put original message.

> and not also first 2 lines (so I need not to delete them)

I've modified the quote macro on the FAQ to do what I think you're
asking.  Be warned that if you are answering a message with less than
5 lines, or a short paragraph at the beginning, this could cause some
problems.

%quotes="%-
%SETPATTREGEXP=""(?is-m)\n*(^-BEGIN\sPGP\sSIGNED.*?\n(Hash:.*?\n)?\s*)?((.*?\n){0,5}?\n)?(.*?)(^(-*?\s*?--\s*\n|_{40,}\s*\n|-BEGIN
 PGP SIGNATURE)|\z)""%-
%REGEXPBLINDMATCH=""%text""%-
%SUBPATT=""5"""

It seems to work, but I would suggest testing it thoroughly before
using it exclusively.

-- 
Thanks for writing,
 Januk Aggarwal

Is it OK to use the AM radio after noon?


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regexp needed - \n\n problem

2002-06-11 Thread Januk Aggarwal

It was foretold that on Tuesday, June 11, 2002 at 10:59 PM, Januk
Aggarwal [JA] would type:

JA> It seems to work, but I would suggest testing it thoroughly before
JA> using it exclusively.

No it doesn't. I apologize for this shoddy work. Though, TB's cookie
selector AI seems to be working well. The following regexp works on
PGP message, but my previous warnings still apply.

%quotes="%-
%SETPATTREGEXP=""(?is-m)\n*(\n-BEGIN\sPGP\sSIGNED.*?\n(Hash:.*?\n)?\s*)?((.*?\n){0,5}?\n)?(.*?)(\n(-*?\s*?--\s*\n|_{40,}\s*\n|-BEGIN
 PGP SIGNATURE)|\z)""%-
%REGEXPBLINDMATCH=""%text""%-
%SUBPATT=""5"""

-- 
Thanks for writing,
 Januk Aggarwal

I should probably engage that largish, grey organ lurking inside of
my skull a bit more often. I think it's called a brain.
-- Simon


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regexp needed - \n\n problem

2002-06-12 Thread Brano

Januk Aggarwal [JA], on Tuesday, June 11, 2002 at 23:09 (-0700) typed
in [EMAIL PROTECTED]">mid:[EMAIL PROTECTED] :


JA> 
%SETPATTREGEXP=""(?is-m)\n*(\n-BEGIN\sPGP\sSIGNED.*?\n(Hash:.*?\n)?\s*)?((.*?\n){0,5}?\n)?(.*?)(\n(-*?\s*?--\s*\n|_{40,}\s*\n|-BEGIN
 PGP SIGNATURE)|\z)""%-

thank Januk for your reply. I tried everything, but it doesn't help.
I don't know, why this doesn't work:
%SETPATTREGEXP="(?is-m)(.*\n){1,5}\n\n(.*)|((.*))"
%SUBPATT="2"

the problem is of course in:
(.*\n){1,5}\n\n(.*)

I tried everything, but I can't solve this problem. Maybe I should use
(.+\n){1,5}\n\n(.*)
or something like that, but...don't know, it doesn't work :(

if it will works like I wanted to, after replying this message, you
need not to delete first 2 lines...


-- 

 ...m8s, cu l8r, Brano.

[Whipsplash - Compulsion to shove someone into a swimming]


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regexp needed - \n\n problem

2002-06-12 Thread Januk Aggarwal

Hello Brano,

On Wednesday, June 12, 2002 at 15:47 GMT +0200, a creature mimicking
Brano [B] wrote:

JA>> 
%SETPATTREGEXP=""(?is-m)\n*(\n-BEGIN\sPGP\sSIGNED.*?\n(Hash:.*?\n)?\s*)?((.*?\n){0,5}?\n)?(.*?)(\n(-*?\s*?--\s*\n|_{40,}\s*\n|-BEGIN
 PGP SIGNATURE)|\z)""%-

> thank Januk for your reply. I tried everything, but it doesn't help.

How does it fail, what is the result?  Did you make sure to include
all 4 lines?  If not, did you remember to change the double double
quotes to single double quotes?

> I don't know, why this doesn't work:
> %SETPATTREGEXP="(?is-m)(.*\n){1,5}\n\n(.*)|((.*))"
> %SUBPATT="2"

Try:

(?i-s-m)^(.*\n){1,5}\n(.*)$

But I remind you again, this regexp is not selective at all.  It will
indiscriminately delete the first "paragraph" of the message if
finishes within the first 5 lines of the message.  See
 for an example of such a
message.

-- 
Thanks for writing,
 Januk Aggarwal

I've determined the momentum of my physics assignment so precisely
that it can be anywhere in the universe right now.


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regexp needed - \n\n problem

2002-07-01 Thread Brano

Januk Aggarwal [JA], on Wednesday, June 12, 2002 at 11:39 (-0700)
thinks about in [EMAIL PROTECTED]">mid:[EMAIL PROTECTED] :

JA> Try:
JA> (?i-s-m)^(.*\n){1,5}\n(.*)$

Tried, no success :( it works for you ?
try these messages:

msg1:
=
hi

this is test


msg2:

hi
this is test


JA> But I remind you again, this regexp is not selective at all.

it is possible to make it selective ?

JA>  It will
JA> indiscriminately delete the first "paragraph" of the message if
JA> finishes within the first 5 lines of the message.

yes, this is exactly what I want. If there is no "paragraph" in the
first 5 lines, it should pick whole message.

-- 

 ...m8s, cu l8r, Brano.

[Hey!  Watch out for that bottle-- &#&$#@%&&  NO PERRIER]


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regexp needed - \n\n problem

2002-07-01 Thread Januk Aggarwal

Hello Brano,

It was Thursday, June 27, 2002 at 17:03 GMT +0200, when Brano [B]
wrote:

B> yes, this is exactly what I want. If there is no "paragraph" in the
B> first 5 lines, it should pick whole message.

This seems to work:
%SETPATTREGEXP="(?is-m)^((([^\n]*)\n){0,5}?\s*\n)?(.*)$"%-
%REGEXPBLINDMATCH="%TEXT"%-
%SUBPATT="4"

Note, if you want all paragraphs in the first 5 lines removed, make
the regexp:
(?is-m)^((([^\n]*)\n){0,5}\s*\n)?(.*)$

-- 
Thanks for writing,
 Januk Aggarwal

Reality is merely an illusion, albeit a very persistent one.
  --Albert Einstein (1879-1955)


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]




Re: Regexp needed - \n\n problem

2002-07-01 Thread Brano

Januk Aggarwal [JA], on Monday, July 1, 2002 at 03:38 (-0700) has on
mind in [EMAIL PROTECTED]">mid:[EMAIL PROTECTED] :


JA> This seems to work:
JA> %SETPATTREGEXP="(?is-m)^((([^\n]*)\n){0,5}?\s*\n)?(.*)$"%-
JA> %REGEXPBLINDMATCH="%TEXT"%-
JA> %SUBPATT="4"

superb, now it is working exactly I wanted to. Maybe it could be good
make some "start" delimiter - where real message starts. Maybe it
should be "- \n" :)

hm, did you tried to write "- \n" in editor ? :)

JA> Note, if you want all paragraphs in the first 5 lines removed, make
JA> the regexp:
JA> (?is-m)^((([^\n]*)\n){0,5}\s*\n)?(.*)$

thanks again!!!

-- 

 ...m8s, cu l8r, Brano.

[Beginning to chant: "We want our Internet.  We want our Internet.
We.."]


__
Archives   : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]