I need a regex statement to find any words formatted in CamelCase. Examples include:
- The first character can be any character that is valid in a Windows OS filename.
- Any character can be any character that is valid in a Windows OS filename including
- The word will be delimited by a preceding
[and followed by a
Why? I use an iOS app called Trunk Notes to maintain extensive notes on all aspects of my life (1000+ topics covering 10+ years of work, family, and personal content). Trunk Notes uses Markdown for content formatting but has a specific problem with my CamelCase words. When placed inside a link label or title, e.g. iOS_WriteRoom, the Markdown engine chokes and generates broken HTML. Underscores (
_) in the words also confuse the engine. The simplist solution is to precede the offending word with
/, e.g. /iOS_WriteRoom.
I began making manual edits but realize regex should work for me. So my regex solution will look for the matching pattern and prepend a
/ if a
/ has not already been prepended.
Thank you in advance for any suggestions.