Re: [pcre-dev] Help in rewriting broken lookbehind assertion

Góra strony
Delete this message
Autor: Thorsten Schöning
Data:  
Dla: pcre-dev
Temat: Re: [pcre-dev] Help in rewriting broken lookbehind assertion
Guten Tag Thorsten Schöning,
am Mittwoch, 3. Oktober 2012 um 18:38 schrieben Sie:

> (?i)(?<!(?:(?:p7m|pk7|pkcs7)\.(?:p7m|pk7|pkcs7))|zip|zip\.(?:p7m|pk7|pkcs7))$


In case anyone has similar problems: This regexp can be rewritten to a
valid negative lookbehind assertion if pkcs7 is removed from the
inner branches and just used as a literal in it's only two
combinations it's use in the branches shoudl check.

(a|b|cd)\.(a|b|cd) = (a|b)\.cd|cd\.(a|b)

(?i).+?(?<!(?:p7m|pk7|zip)\.(?:p7m|pk7)|(?:p7m|pk7|zip)\.pkcs7|pkcs7\.(?:p7m|pk7)|zip)$
(?i).+?(?<!(?:p7m|pk7|zip)\.(?:p7m|pk7))(?<!(?:p7m|pk7|zip)\.pkcs7)(?<!pkcs7\.(?:p7m|pk7))(?<!zip)$

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@???
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/


Telefon.............030-2 1001-310
Fax...............05151- 9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow