View Single Post
Old 05-30-2015, 04:01 PM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,645
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Find:
Code:
<span class="calibre5">(?<mygroup>([^<>]+))</span>
Replace:
Code:
\g<mygroup>
Not really worth going to the trouble of creating a named group in this case.

Anything (OK not anything--but for the purpose of this exercise) in parentheses is a capture group.

So in my expression:
Code:
<span class="calibre5">([^<>]+)</span>
Everything matched within the parentheses (a capture group) can be substituted in the Find expression using \1. If you had more than one capture group, they would be \2 \3 ... etc.

Your way (named groups) will work, but there's no need to go to all that trouble, IMO.

I learned nearly everything I know about regex from http://www.regular-expressions.info/

Last edited by DiapDealer; 05-30-2015 at 04:03 PM.
DiapDealer is offline   Reply With Quote