MBR,

I am curious as to why you include the C-q before the space. Space
inserts itself literally. 

Try this regexp:  
\(\w\)\([A-Z]\)

with this replacement: 
\1 \2

and you can skip the step of deleting the first space character at the
beginning of the region and also adjusting extra spaces before each
camelcase word. This replaces every occurrence of a word constituent
followed by a capital letter with a space between the two.

If you do this often, try this lisp code:

(defun de-hump ()
       "Split up CamelCase words with a space"
       (interactive)
       (replace-regexp "\\(\\w\\)\\([A-Z]\\)" "\\1 \\2" nil (point)
(mark)))

Which will do the replacement on the region, so there will be no need to
narrow the buffer.

Kevin Buchs | Senior Engineer | SPPDG | 507-538-5459 |
buchs.ke...@mayo.edu
Mayo Clinic | 200 First Street SW | Rochester, MN 55905 |
http://www.mayo.edu/sppdg 

Reply via email to