Re: [pcre-dev] probably basic pcre question

Page principale
Supprimer ce message
Auteur: jamal
Date:  
À: pcre-dev
Sujet: Re: [pcre-dev] probably basic pcre question
On Wed, 2008-12-03 at 12:09 -0400, jamal wrote:

> Sigh - you are right about #2/#3; the proper output looks like:
>
> ----
> 0: E: e1\x0d\x0aA: a1\x0d\x0aB: b1\x0d\x0a\x0d\x0aCRAP: c1
> 1: E: e1\x0d\x0aA: a1\x0d\x0aB: b1\x0d\x0a\x0d\x0aCRAP: c1
> 2: e1\x0d\x0aA: a1\x0d\x0aB: b1\x0d\x0a\x0d\x0aCRAP: c1
> 3: \x0d\x0a\x0d\x0aB: b1\x0d\x0a\x0d\x0aCRAP: c1
> ----


Ok, i noticed i screwed up again; here are the proper details:

---
pcrecompile as per posted snippet: (^E: (.*?)(\r\n\r\n))
Input data:
E: a1\r\nB: b1\r\n\r\n E: a2\r\nB: b2\r\n\r\n E: a3\r\nCRAP

Output vector:

0: E: a1\r\nB: b1\r\n\r\n E: a2\r\nB: b2\r\n\r\n E: a3\r\nCRAP
1: E: a1\r\nB: b1\r\n\r\n E: a2\r\nB: b2\r\n\r\n E: a3\r\nCRAP
2: a1\r\nB: b1\r\n\r\n E: a2\r\nB: b2\r\n\r\n E: a3\r\nCRAP
3: \r\n\r\nE: a2\r\n B: b2\r\n\r\nE: a3\r\nCRAP

And with pcretest same regexp:

re> /(^E: (.*?)(\r\n\r\n))/s
data> E: a1\r\nB: b1\r\n\r\n E: a2\r\nB: b2\r\n\r\n E: a3\r\nCRAP

0: E: a1\x0d\x0aB: b1\x0d\x0a\x0d\x0a
1: E: a1\x0d\x0aB: b1\x0d\x0a\x0d\x0a
2: a1\x0d\x0aB: b1
3: \x0d\x0a\x0d\x0a
-----------------

cheers,
jamal