Guest dams Posted November 15, 2020 Report Share Posted November 15, 2020 Hello , I would like to know how to select the second or third ... result of a regex with ketarin Ketarin only selects the first valid result of a regex! I would like him to select the second or third ... the goal is to download several links on the same web page with a never identical and unknown link name Link to comment Share on other sites More sharing options...
shawn Posted November 21, 2020 Report Share Posted November 21, 2020 This is by design. RegEx is an explicit language and the syntax is intended to be consistent. If you want to select the second or third instance just include the regex twice (for the second instance) or three times (for the third instance), and so on, with ".+?" connectors. Here's an example for selecting the newest and two other recent versions of FFmpeg from here. First instance: (/[^'"<>]+win64-gpl.zip) Second instance: /[^'"<>]+win64-gpl.zip.+?(/[^'"<>]+win64-gpl.zip) Third instance: /[^'"<>]+win64-gpl.zip.+?/[^'"<>]+win64-gpl.zip.+?(/[^'"<>]+win64-gpl.zip) Link to comment Share on other sites More sharing options...
dams Posted November 22, 2020 Report Share Posted November 22, 2020 i try but its not work when a skip () all the line is off in example i need the select in yellow Link to comment Share on other sites More sharing options...
shawn Posted November 22, 2020 Report Share Posted November 22, 2020 When including screenshots it's best to also include the specific regex patterns or other data as text so it's easier to read. Your problem is in the second parentheses group. It should either have the parentheses removed or have "?:" included to make it a non-capturing group. Note in my example that I only attempted to capture the final group. If you capture previous text regex will stop processing there. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now