re = /jquery-?[0-9.]*(.min|.slim|.slim.min)?\.js/m
str = 'https://www.staging2.villageofalamance.com/wp-includes/js/jquery/jquery.min.js
https://www.staging2.villageofalamance.com/wp-includes/js/jquery/jquery.js
https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.js
https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js
https://code.jquery.com/jquery-3.5.1.min.js
https://code.jquery.com/jquery-3.5.1.js
https://code.jquery.com/jquery-3.5.1.slim.js
https://code.jquery.com/jquery-3.5.1.slim.min.js
https://c0.wp.com/c/5.2.2/wp-includes/js/jquery/jquery.js
## Shouldn\'t be excluded
https://www.staging2.villageofalamance.com/wp-content/plugins/league-table/public/assets/js/tablesorter/jquery.tablesorter-min.js?ver=2.08
https://www.staging2.villageofalamance.com/wp-content/themes/bridge/js/plugins/jquery.appear.js?ver=5.6
https://www.staging2.villageofalamance.com/wp-content/themes/bridge/js/plugins/jquery.flexslider-min.js?ver=5.6'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html