[lxml-dev] [objectify] __MATCH_PATH_SEGMENT regex modificationsuggestion

Holger Joukl Holger.Joukl at LBBW.de
Tue Jan 2 14:56:05 CET 2007


"Holger Joukl" <Holger.Joukl at LBBW.de> schrieb am 29.12.2006 16:16:12:

> I suggest to loosen the __MATCH_PATH_SEGMENT regex a little
> [...]
>
> cdef object __MATCH_PATH_SEGMENT
> __MATCH_PATH_SEGMENT = re.compile(
>     r"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
>     re.U).match
>
> (Changed: ([^.{}]+) replaces (\w+))

Sorry that was too loose as it destroys the correct matching of the
index part; it should read

__MATCH_PATH_SEGMENT = re.compile(
    r"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}\[\]]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
    re.U).match

(Changed: (([^.{}\[\]]+) replaces (\w+))

Holger

Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene
Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde,
verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail
sodann. Das unerlaubte Kopieren sowie die unbefugte Übermittlung sind nicht
gestattet. Die Sicherheit von Übermittlungen per E-Mail kann nicht
garantiert werden. Falls Sie eine Bestätigung wünschen, fordern Sie bitte
den Inhalt der E-Mail als Hardcopy an.

The contents of this  e-mail are confidential. If you are not the named
addressee or if this transmission has been addressed to you in error,
please notify the sender immediately and then delete this e-mail.  Any
unauthorized copying and transmission is forbidden. E-Mail transmission
cannot be guaranteed to be secure. If verification is required, please
request a hard copy version.




More information about the lxml-dev mailing list