>>>> "Reiner" == Reiner Steib
<4.uce.03.r.s(a)nurfuerspam.de> writes:
Reiner> (replace-in-string fileurl "\\(\\.info\\)?\\(\\.gz\\)?\\'"
"")))
Reiner> ... which lead to the inf-loop. Is there a better way
Reiner> than calling `replace-in-string' twice?
(replace-in-string fileurl "\\(\\.info\\|\\.gz\\)+" "")
fixes the infloop bug, but in general that's also a hack
("foo.gz.info" is probably an uncompressed Info file documenting
"foo.gz").
Another possibility is
(replace-in-string fileurl "\\.info\\(\\.gz\\)$" "")
but that requires the .info extension. Probably the best bet is
(replace-in-string fileurl "\\(\\.info\\|\\.gz$\\)+" "")
You're just running into the famous saying: "Some people, when they
have a text-processing problem, say 'I know, I'll use regular
expressions!' Now they have two problems." What you're really doing
here, conceptually, is parsing, and regexp matchers aren't as good at
that as LR parsers. Problem is, there is no "lr-parse" set of
functions. semantic bovination is awfully heavy-weight for this
problem. ;-)
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.