View Single Post
Old 12-01-2011, 06:29 PM   #8
ElMiko
Addict
ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.
 
ElMiko's Avatar
 
Posts: 320
Karma: 56788
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by Serpentine View Post
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.
Have you confirmed this? Because this was one of the things i tried first and it didn't seem to make a difference. Just tried it again, and still no difference.

EDIT:
Although this would still be useful information to have, I have found a work-around for my current problem. I just replace the variable text (through a search that uses (| )) with a consistent text. Thus eliminating all the parentheticals, before I do another search/replace that can use prentheticals expression without being overloaded by the all the instances of (| ).

Last edited by ElMiko; 12-01-2011 at 06:56 PM.
ElMiko is offline   Reply With Quote