Chris, You can use lookaround assertions and case conversion to achieve this.
This patten matches (and captures) the first word character that is preceded either by whitespace or by the beginning of the line: (?<=^| )(\w) This replacement text converts that character to uppercase: \U\1\E Hope this helps! -sam On 2015-09-21 8:01 AM, Christian C. Berclaz wrote: > Hello > > I'm really not good at RegEx (but learning) and I'm trying to do the > following: > > with a multi-words strings I'd like to capitalise every word unless a > word is attached to the previous with an hyphen, e.g.: > > little green woodpecker ==> Little Green Woodpecker > crimson-bellied woodpecker ==> Crimson-bellied Woodpecker > > I'm sure there is a way to do it elegantly but I'm stuck and couldn't > find an answer on the web. > > Any help would be appreciated. > > Cheers > Chris > > -- > This is the BBEdit Talk public discussion group. If you have a > feature request or would like to report a problem, please email > "[email protected]" rather than posting to the group. > Follow @bbedit on Twitter: <http://www.twitter.com/bbedit> > > --- > You received this message because you are subscribed to the Google > Groups "BBEdit Talk" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. -- This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
