![]() |
Find pattern for series from 1287 to 9834 - 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: Find pattern for series from 1287 to 9834 (/Thread-Find-pattern-for-series-from-1287-to-9834) |
Find pattern for series from 1287 to 9834 - abhideshpande001 - 07-28-2015 I have created pattern like this. but it is giving me incorrect result. Please help me with this. Code: patrn="([1][2-9][0-9][0-9]|[9][8-9][0-3][0-3]|9834)" ![]() RE: Find pattern for series from 1287 to 9834 - abhideshpande001 - 07-29-2015 This pattern would work. Code: patrn="([1-8][2-8][8-9][7-9]|[2-8][0-9][0-9][0-9]|[9][0-8][0-3][0-4])" RE: Find pattern for series from 1287 to 9834 - akhi_s27 - 07-29-2015 This regex has many flaws. for eg: 1900 is not getting matched which is withing the range. these types of conditions are best if handled in code than by regex. Anyways...the regex for this specific condition is as below: Code: (?(^128[7-9]{1}$)(128[7-9]) RE: Find pattern for series from 1287 to 9834 - abhideshpande001 - 08-05-2015 Thanks Mate. ![]() |