camel casing regular expression

Forum for TextAloud version 3

Moderator: Jim Bretti

Post Reply
sulu
Posts: 8
Joined: Sun Jul 03, 2011 5:05 pm
Contact:

camel casing regular expression

Post by sulu »

Does anyone remember what the regular expression is for a string with mixed casing, such as: PageBreak
?

I need to read .NET articles where I have noun strings like this run together.

-su
Jim Bretti
Posts: 1558
Joined: Wed Oct 29, 2003 11:07 am
Contact:

Re: camel casing regular expression

Post by Jim Bretti »

One way you can match all camel case text in an article is with an expression like this:

[A-Z][a-z]+[A-Z][a-z]+

(The Case Sensitive checkbox for the dictionary entry should be checked).

If you're trying to insert a space before the 2nd upper case character, you may want to include a word boundary check (word boundary characters before and after the word). The complete dictionary entry could look like this:

Text Matching: Regular Expression:
(?<=\b)([A-Z][a-z]+)([A-Z][a-z]+)(?=\b)

Pronounce As: Respell:
$1 $2

Again, make sure the Case Sensitive checkbox is selected.

Is that what you're looking for?
Jim Bretti
NextUp.com
Post Reply