Help with a regular expression???
Ray Parrish
crp at cmc.net
Wed Jan 27 13:36:39 UTC 2010
Hello,
I am working on some code to take a textually formatted list, and change
it into an HTML formatted list. I have input that looks like the following -
- visual wxWindows frame design,
- object inspector and explorer,
- syntax highlighting editor with code completion, call tips and code
browsing for Python code,
- syntax highlighting editor for C, C++, HTML, XML, config files (INI
style),
- documentation generation,
- an integrated Python debugger,
- integrated help,
- a Python Shell,
- an explorer able to browse, open/edit, inspect and interact with
various data sources including files, CVS, Zope, FTP, DAV and SSH,
- an UML view generator.
What I need to do is replace the occurrences of 4 spaces followed by any
character, with an underline character, a space character, and the
original fifth character on the line to indicate line continuation to a
following routine, which will concatenate the pieces on the continued
lines onto the previous line segments.
The part I do not know how to do is preserving the fifth character in an
assignment like the following [the entire data section above will be in
one variable]
Data=${Data/ [a-z,A-Z]/_ }
As you can likely see, that code line will not work yet, as I do not
know how to specify that whatever character gets found after the fourth
space is to be part of the replace term. I'm not even sure that I have
properly specified the search term to match the single fifth character
either.
Thanks for any help you can be.
Later, Ray Parrish
--
Linux dpkg Software Report script set..
http://www.rayslinks.com/LinuxdpkgSoftwareReport.html
Ray's Links, a variety of links to usefull things, and articles by Ray.
http://www.rayslinks.com
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things, including my poetry.
http://www.writingsoftheschizophrenic.com
More information about the ubuntu-users
mailing list