I was hoping someone already had this done but what I'm trying to do is output a list of semantic versions of various javascript libraries. Let's assume I have the the following input:
- https://code.jquery.com/jquery-2.1.3.js
- //maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css
- https://cdnjs.cloudflare.com/ajax/libs/1140/2.0/1140.css
- https://cdnjs.cloudflare.com/ajax/libs/Base64/0.3.0/base64.min.js
- https://cdnjs.cloudflare.com/ajax/libs/angular-google-maps/2.1.0-X.10/angular-google-maps.min.js
- https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/2.1.8-M1/swagger-ui.min.js
- https://cdnjs.cloudflare.com/BLAH/BLAH.min.js
I'd like to call a function on each of these strings and have it output the semver from the path:
- 2.1.3
- 3.3.4
- 1140 or 2.0 (prefer)
- 0.3.0
- 2.1.0-X.10
- 2.1.8-M1
- null
I was unable to find any existing libraries and was hoping someone had one handy that worked on IE9ish.