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){ 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?? |