View Single Post
Old 12-01-2011, 04:14 PM   #6
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
Quote:
Originally Posted by ElMiko View Post
Another related question, when you have more than 9 parenthetically isolated expressions, how do you refer to the ones from 10 onward?
There doesn't seem to be any mention of this limit in the relevant Qt documentation, however most regex implementations work as you would expect. In this case, I would suggest removing capturing groups that you are not using, by making them into non-capturing groups.
Code:
Capturing :     (Capture( the (third) word))     // The word 'third' is group 3
Non-capturing : (?:Capture(?: the (third) word)) // The word 'third' is group 1
Non-capturing groups work exactly like normal groups, except that they are not returned.

Last edited by Serpentine; 12-01-2011 at 04:19 PM. Reason: code block
Serpentine is offline   Reply With Quote