libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [4/11] Native MSVC support (file-magic-glob)


From: Paolo Bonzini
Subject: Re: [4/11] Native MSVC support (file-magic-glob)
Date: Fri, 13 Jul 2007 17:25:59 +0200
User-agent: Thunderbird 2.0.0.4 (Macintosh/20070604)


s/[A-Za-z]/*|&|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*/g
s/\*|\(.\)|[A-Za-z]*\1[A-Za-z]\{25\}\([A-Za-z]\)[A-Za-z]*\*/[\1\2]/g

Ah, that's a nice solution. I was considering the following:

This is inspired me the following in turn, which is faster than my ultra-compact version and also uses little pattern space. I haven't benchmarked it against yours:

y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
h
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
G
s/^/\n/
:f
s/\n\([A-Za-z]\)\(.*\)\(\n\)\(.\)/[\1\4]\3\2\3/
s/\n\([^A-Za-z]\)\(.*\)\(\n\)./\1\3\2\3/
/\n\n$/!bf
s///





reply via email to

[Prev in Thread] Current Thread [Next in Thread]