General questions about using TextPad
Moderators: AmigoJack , bbadmin , helios , MudGuard
ciaolorenzo
Posts: 4 Joined: Mon Jul 09, 2007 11:50 pm
Location: Berkeley, CA
Post
by ciaolorenzo » Thu Jul 19, 2007 11:29 pm
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
Bob Hansen
Posts: 1516 Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:
Post
by Bob Hansen » Thu Jul 19, 2007 11:49 pm
Search for: ([[:lower:]])([[:upper:]])
Replace with: \1 \2
Checkmark in Regular Expressions
Checkmark in Match Case
Note the space between \1 and \2
Hope this was helpful.............good luck,
Bob
ciaolorenzo
Posts: 4 Joined: Mon Jul 09, 2007 11:50 pm
Location: Berkeley, CA
Post
by ciaolorenzo » Fri Jul 20, 2007 3:45 am
That did it !
Thanks a bunch
JBNY
Posts: 7 Joined: Wed Mar 25, 2009 7:24 pm
Post
by JBNY » Mon Oct 05, 2009 2:36 pm
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
-Joe
ben_josephs
Posts: 2464 Joined: Sun Mar 02, 2003 9:22 pm
Post
by ben_josephs » Mon Oct 05, 2009 9:49 pm
[^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
Fi nd what: (Ma?c) ([[:upper:]])
Rep lace with: \1\2
JBNY
Posts: 7 Joined: Wed Mar 25, 2009 7:24 pm
Post
by JBNY » Tue Oct 06, 2009 4:59 pm
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
-Joe