I would like to regex the fullpath of the css, for example I have this:
<link rel="stylesheet" href="../assets/myCssFile.css"/>
I would like to regex: /assets/myCssFile.css
What I tried is this: /(?:href)=("|').*?([\w.]+\.(?:css))\1/gi
but this returns me this: href="../assets/myCssFile.css"
Can someone help me out with the regex.
BTW: It is an response text of an ajax request which returns me a string of the html page
href=\"(.*\.css)"
This will return "../assets/myCssFile.css" in a capture group.
https://regex101.com/r/a44Axz/1
All it is doing is saying:
I am only interested in text within quotes that immediately follows an "href" and only if it is a ".css" file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With