Re: RegEx partial matching
From: Stanimir Stamenkov (s7an10_at_netscape.net)
Date: 11/12/04
- Next message: Chris Uppal: "Re: How to paint in Component Graphics?"
- Previous message: FISH: "Re: Http to port different than 80?"
- In reply to: Yamin: "Re: RegEx partial matching"
- Next in thread: skeptic: "Re: RegEx partial matching"
- Reply: skeptic: "Re: RegEx partial matching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 12 Nov 2004 15:39:52 +0200
/Yamin/:
> There is a very simple solution to this.
> Just keep appending data to your main buffer, and do a simple pattern
> match. If you don't want your buffer to be too big, simply chop off
> any early data that you know cannot match the string.
How do I know which earlier data cannot match the regular
expression? (see bellow)
> Suppose the string you're trying to match is 10 character long.
> If you've read 20 characters already, and you have not found a full
> match, you can safely discard the lower 10 characters. Normally I
> like to be safe and just keep 3x the length of the pattern I'm looking
> for.
I want to match full featured regular expressions not just fixed
strings (as I've included in my example for simplicity). I can't
possibly determine the result length which would match some regular
expression as in:
opentag [.\n]* closetag
What would be the length of "[.\n]*" ?
The only reasonable solution is to use rexeg library which supports
streaming source as Adam (bilbo) has already proposed in another
message in this thread.
-- Stanimir
- Next message: Chris Uppal: "Re: How to paint in Component Graphics?"
- Previous message: FISH: "Re: Http to port different than 80?"
- In reply to: Yamin: "Re: RegEx partial matching"
- Next in thread: skeptic: "Re: RegEx partial matching"
- Reply: skeptic: "Re: RegEx partial matching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|