Page 1 of 1

Inserting a space between letters strung together

Posted: Thu Jul 19, 2007 11:29 pm
by ciaolorenzo
Hi,
My data looks like this

EarlMarchLookedonHisDyingChild, The.rtf

I'd like to be able to recognize that the letter preceding a capital is the end of a word, so that the data will look like this


Earl March Lookedon His Dying Child, The.rtf


I know that during a first pass I won't be able to break apart "Lookedon". That's okay for now.

Thanks

Posted: Thu Jul 19, 2007 11:49 pm
by Bob Hansen
Search for: ([[:lower:]])([[:upper:]])
Replace with: \1 \2


Checkmark in Regular Expressions
Checkmark in Match Case

Note the space between \1 and \2

Posted: Fri Jul 20, 2007 3:45 am
by ciaolorenzo
That did it !
Thanks a bunch

Posted: Mon Oct 05, 2009 2:36 pm
by JBNY
I have been using this, but I am stumped on how to get it NOT to pick up words like

McArthur
MacDaddy

Basically not process anything that starts with Mc or Mac

I tried
[^Mc]([[:lower:]])([[:upper:]])

But that seems to not work. Any suggestions?

Thanks
-Joe

Posted: Mon Oct 05, 2009 9:49 pm
by ben_josephs
[^Mc] matches any single character that isn't an M or a c (or a newline).

I don't believe you can do what you want in one step with TextPad's weak regex engine.

But you can allow the prefixes to be separated, and then put them back together with
Find what: (Ma?c) ([[:upper:]])
Replace with: \1\2

Posted: Tue Oct 06, 2009 4:59 pm
by JBNY
Thanks, I'll try that. I have acces to other regex products. Is this something I could do with regex in general? If so, do you know what the expression might be.

Thanks
-Joe