BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to exclude CR and LF of an Char Set in an Regular Expres

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Antonio Cambule
Guest





PostPosted: Thu Jan 15, 2004 11:48 am    Post subject: How to exclude CR and LF of an Char Set in an Regular Expres Reply with quote



Hi,

I use D7 with TRegExpr to Parse for Regular Expressions.
I need to do this:

Source: Sample {Carriage Return}
Te xt

What I want: S,a,m,p,l,e,T,e,x,t

What I get: S,a,m,p,l,e,
,
Te,,x,t

The Parser should find every single Character except an CR and an LF.

What I did:

[x01-xF7] <-- Finds all Characters I need + CR and LF. But I don't
want to have CR and LF.

I tried these:
1. [x01-xF7^x0aa0d]
2. [x01-xF7][^x0aa0d]


Nothing realy did it. I couldn't find an example for this case. So I'm
in need of help.

regards

Antonio Cambule

Back to top
AlanGLLoyd
Guest





PostPosted: Thu Jan 15, 2004 12:56 pm    Post subject: Re: How to exclude CR and LF of an Char Set in an Regular Ex Reply with quote



In article <40067E24.2000706 (AT) stueber (DOT) de>, Antonio Cambule <antonio (AT) stueber (DOT) de>
writes:

Quote:
The Parser should find every single Character except an CR and an LF.

What I did:

[x01-xF7] <-- Finds all Characters I need + CR and LF. But I don't
want to have CR and LF.

I tried these:
1. [x01-xF7^x0aa0d]
2. [x01-xF7][^x0aa0d]



I would have thought ...

[x01-x09,x0B,x0C,x0E-xF7]

Alan Lloyd
[email]alanglloyd (AT) aol (DOT) com[/email]

Back to top
Antonio Cambule
Guest





PostPosted: Thu Jan 15, 2004 1:33 pm    Post subject: Re: How to exclude CR and LF of an Char Set in an Regular Ex Reply with quote





Hi,

Quote:
I would have thought ...

[x01-x09,x0B,x0C,x0E-xF7]

Thankx, seems to work.

Maybe I've thought do difficult.

Quote:
I tried these:
1. [x01-xF7^x0aa0d]
2. [x01-xF7][^x0aa0d]

Isn't there a possibility to negate a part of a set
combining these [] and [^]?

thanks again.

greetings

Antonio Cambule



Back to top
VBDis
Guest





PostPosted: Fri Jan 16, 2004 12:01 am    Post subject: Re: How to exclude CR and LF of an Char Set in an Regular Ex Reply with quote

Im Artikel <40067E24.2000706 (AT) stueber (DOT) de>, Antonio Cambule <antonio (AT) stueber (DOT) de>
schreibt:

Quote:
The Parser should find every single Character except an CR and an LF.

These might work:
[^x0ax0d]
or possibly
[^x0a,x0d]
(commas may be required inside sets)

What about the space in "Te xt"?

DoDi

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.