Micro Focus QTP (UFT) Forums
need a regular expression. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: need a regular expression. (/Thread-need-a-regular-expression)



need a regular expression. - anu05446 - 11-26-2014

i have a string as below.

Code:
for(GE_ES_Checklist_Item_Submission__c sub : subList){




for(Id temp : userOrGroupIds.get(queueMap.get(cia.GE_OG_Assigned_Queue__c))){  




for (GE_ES_Submission_Item_Proxy__c r : [Select GE_ES_Risk_Checklist_Item__c,GE_ES_Risk_Checklist_Item__r.GE_OG_GS_DealMngt__c,GE_ES_Risk_Checklist_Item__r.GE_OG_GS_DealMngt__r.GE_ES_Opportunity__r.RecordType.name from GE_ES_Submission_Item_Proxy__c where GE_ES_Submission_Proxy__c = :this.submitSession]) {

I need a regex which gives 3 matches,

I've come with the regex "for\(\w*\s*\w*\s*:+\s*\w*\.*\w*\)\s*\{" but it gives only 2 matches and if i use "for\(\w*\s*\w*\s*:+\s*.*\)\s*\{" it matches the full string above and gives 1 match.

Please help.

this is working

"for\s*\(\w*\s*\w*\s*:+\s*\[*.*\]*\w*\.*\w*\)\s*\{"


can it be simplified further?

this is working.

"for\s*\(\w*\s*\w*\s*:+\s*\[*.*\]*\w*\.*\w*\)\s*\{"

can it be simplified further??