Regex'ing null bytes

Jonas Galvez jonas at jonasgalvez.com
Wed Apr 21 12:31:38 EDT 2004


> [Fredrik Lundh]
> the "pre" (pcre) engine doesn't support null bytes in pattern
> strings, but it does understand octal escapes.
>
> in other words, use double backslashes, or an "r" string:
>
>     "\\000"
>     r"\0"
>
> </F>


As I said, I'm not going to use regexes anymore, but... good to know!

Thanks a lot for the info.





=-
Jonas Galvez
jonasgalvez.com/blog
macromedia.com/go/team








More information about the Python-list mailing list