Need a regex to get font name and weight in a google fonts stylesheet path

Total Post:88

Points:616

HTML5 
 1765  View(s)
Ratings:
Rate this:

Let's say I have this string:

<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,600,700" rel="stylesheet" type="text/css">

I need to remove the text before and after "Open+Sans:400italic,400,300,600,700" Any of you code-wizards who knows how to make a regex for this? Or is there a better way than using 

  1. Re: Need a regex to get font name and weight in a google fonts stylesheet path

    A Perl style regex perhaps too much crafted for your example:

    s/<link href="[^"]*family=([^"]*)".*/$1/

      Modified On Mar-31-2018 05:08:08 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.