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
camel casing regular expression
Moderator: Jim Bretti
-
- Posts: 1558
- Joined: Wed Oct 29, 2003 11:07 am
- Contact:
Re: camel casing regular expression
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?
[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
NextUp.com