Thread: Regex examples
View Single Post
Old 06-22-2020, 01:49 PM   #648
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,746
Karma: 24032915
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Mister L View Post
Example:
<span class="Cap">F</span><span class="SmallCap">IRST WORD OF THE SENTENCE IS ALWAYS CAPITALISED,</span> <span class="Cap">O</span><span class="SmallCap">THER</span> <span class="Cap">W</span><span class="SmallCap">WORDS IN THE SENTENCE MAY OR MAY NOT BE CAPITALISED</span>

Desired result :
First word of the sentence is always capitalised, Other Words in the sentence may or may not be capitalised.

Actual result:
First word of the sentence is always capitalised,</span> <span class="cap">o</span><span class="smallcap">ther</span> <span class="cap">w</span><span class="smallcap">words in the sentence may or may not be capitalised
That's not the result that I'm getting. With:

Find:<span class="Cap">(.)</span><span class="SmallCap">(.*?)</span>
Replace:\1\L\2\E


I'm getting:

First word of the sentence is always capitalised, Other Wwords in the sentence may or may not be capitalised

(None of the Regex options are checked.) You'll need to uncheck the Minimal Match option.
Doitsu is offline   Reply With Quote