java script extract link from stringWhat is the difference between String and string in C#?Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?How do I remove a property from a JavaScript object?How do I read / convert an InputStream into a String in Java?How do I make the first letter of a string uppercase in JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?Does Python have a string 'contains' substring method?How do I convert a String to an int in Java?How do I remove a particular element from an array in JavaScript?

1960's book about a plague that kills all white people

Why does Kotter return in Welcome Back Kotter?

Is it possible to run Internet Explorer on OS X El Capitan?

Is it possible to create light that imparts a greater proportion of its energy as momentum rather than heat?

Intersection of two sorted vectors in C++

Should I tell management that I intend to leave due to bad software development practices?

How can I tell someone that I want to be his or her friend?

Is it legal for company to use my work email to pretend I still work there?

Watching something be written to a file live with tail

How can saying a song's name be a copyright violation?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Forgetting the musical notes while performing in concert

Arrow those variables!

What is a clear way to write a bar that has an extra beat?

Theorems that impeded progress

90's TV series where a boy goes to another dimension through portal near power lines

Is it canonical bit space?

Anagram holiday

Why do bosons tend to occupy the same state?

What does it mean to describe someone as a butt steak?

What is the intuition behind short exact sequences of groups; in particular, what is the intuition behind group extensions?

Is it unprofessional to ask if a job posting on GlassDoor is real?

I Accidentally Deleted a Stock Terminal Theme

I'm flying to France today and my passport expires in less than 2 months



java script extract link from string


What is the difference between String and string in C#?Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?How do I remove a property from a JavaScript object?How do I read / convert an InputStream into a String in Java?How do I make the first letter of a string uppercase in JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?Does Python have a string 'contains' substring method?How do I convert a String to an int in Java?How do I remove a particular element from an array in JavaScript?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















so I have this code on string:



<html class="
no - js ie ie6 lt - ie9 lt - ie8 lt - ie7 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 7]> <html class="
no - js ie ie7 lt - ie9 lt - ie8 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 8]> <html class="
no - js ie ie8 lt - ie9 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 9]> <html class="
no - js ie9 search - context en_US " lang="
en - US "> <![endif]--><!--[if gt IE 9]><!--> <html class="
no - js search - context en_US " lang="
en - US "> <!--<![endif]--> <head><title>art anime | Tumblr</title><!--[if ie]><meta http-equiv="
X - UA - Compatible " content="
IE = Edge, chrome = 1 "/><![endif]--><meta http-equiv="
Content - Type " content="
text / html;
charset = utf - 8 "> <meta http-equiv="
x - dns - prefetch - control " content="
off "> <meta name="
application - name " content="
Tumblr "> <meta name="
msapplication - TileColor " content="
#3645d"> <meta name= "msapplication-TileImage"
content = "https://assets.tumblr.com/images/msfavicon.png?_v=245323c5cb69e705ea213d9ed60e543a" > < link rel = "shortcut icon"
href = "https://assets.tumblr.com/images/favicons/favicon.ico?_v=8bfa6dd3e1249cd567350c606f8574dc"
type = "image/png" > < meta name = "p:domain_verify"
content = "d06c4fa470a9a6935c9a7b43d57eb7d2" > < link rel = "apple-touch-icon"
sizes = "57x57"
href = "https://assets.tumblr.com/images/apple-touch-icon-57x57.png?_v=81406f92242ce0166328bc17e4473e6e"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "60x60"
href = "https://assets.tumblr.com/images/apple-touch-icon-60x60.png?_v=20e3957f7027b72d5aa60085204ae63c"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "72x72"
href = "https://assets.tumblr.com/images/apple-touch-icon-72x72.png?_v=8df24181ba31066d8710f67c9a287241"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "76x76"
href = "https://assets.tumblr.com/images/apple-touch-icon-76x76.png?_v=455617cae13eff40acffac5e489bde50"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "120x120"
href = "https://assets.tumblr.com/images/apple-touch-icon-120x120.png?_v=5604f95b165810101ea055f2cb5206b9"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "128x128"
href = "https://assets.tumblr.com/images/apple-touch-icon-128x128.png?_v=fd39307925fa7f1ada28b08d67e93da1"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "144x144"
href = "https://assets.tumblr.com/images/apple-touch-icon-144x144.png?_v=dfd5b392d423c5f0278d9f498abda2fa"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "152x152"
href = "https://assets.tumblr.com/images/apple-touch-icon-152x152.png?_v=73c2019bf6a75f7e476e01ba136cebec"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "180x180"
href = "https://assets.tumblr.com/images/apple-touch-icon-180x180.png?_v=00127c0342d97d5f36cfd8aa6439ca10"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "195x195"
href = "https://assets.tumblr.com/images/apple-touch-icon-195x194.png?_v=0"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "196x196"
href = "https://assets.tumblr.com/images/apple-touch-icon-196x196.png?_v=bb4b7eef0ef8e28101acdf2f0c265cc7"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "228x228"
href = "https://assets.tumblr.com/images/apple-touch-icon-228x228.png?_v=0c7874da12e347c2bdf95e5baa3f396a"
type = "image/png" > < link rel = "canonical"
href = "https://www.tumblr.com/search/art%20anime/recent" > < meta name = "robots"
id = "robots"
content = "noodp,noydir" > < meta name = "description"
id = "description"
content = "Tumblr is a place to express yourself, discover yourself, and bond over the stuff you love. It's where your interests connect you with your people." > < meta name = "keywords"
id = "keywords"
content = "tumblelog, blog, tumblog, tumbler, tumblr, tlog, microblog" > < meta name = "viewport"
id = "viewport"
content = "width=960" > < meta name = "tumblr-form-key"
id = "tumblr_form_key"
content = "!1231553203788|mOZjoWSzPU6eNRkpuhEtzoBJmdA" > < meta name = "tumblr-gpop"
id = "tumblr_gpop"
content = "Tumblr" > < meta name = "og:title"
id = "og_title"
content = "art anime | Tumblr" > < meta name = "og:image"
id = "og_image"
content = "https://66.media.tumblr.com/06afadc2cafb6945065a4b10d61f3b45/tumblr_poqjiuUUGO1tvlw71o1_r1_500.jpg" > < script type = "application/ld+json" >


I want to get content="https://66.media.tumblr.com ... etc
link from this string and for you know the string is updating every hour



I try this way not working I result -1 and 0
on google script ( java script ) cods



function urll() var response =
UrlFetchApp.fetch("https://www.tumblr.com/search/art+anime/recent");
var str = response.getContentText(); var m=str.search('is=“og_image”
content=“(^”*)'); Logger.log(m);










share|improve this question
























  • This is the exact string you want to parse?

    – obscure
    Mar 21 at 22:10











  • yeah , how i exact ?

    – aqbal lahor
    Mar 21 at 22:13











  • Well this 'string' doesn't look like a plain string - more like html - and not really usable as a string with all those " characters in it. Where do you get it from?

    – obscure
    Mar 21 at 22:36











  • how you storing this sting content, it gives error when you put this in any variable,

    – Bhalke
    Mar 22 at 6:25

















0















so I have this code on string:



<html class="
no - js ie ie6 lt - ie9 lt - ie8 lt - ie7 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 7]> <html class="
no - js ie ie7 lt - ie9 lt - ie8 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 8]> <html class="
no - js ie ie8 lt - ie9 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 9]> <html class="
no - js ie9 search - context en_US " lang="
en - US "> <![endif]--><!--[if gt IE 9]><!--> <html class="
no - js search - context en_US " lang="
en - US "> <!--<![endif]--> <head><title>art anime | Tumblr</title><!--[if ie]><meta http-equiv="
X - UA - Compatible " content="
IE = Edge, chrome = 1 "/><![endif]--><meta http-equiv="
Content - Type " content="
text / html;
charset = utf - 8 "> <meta http-equiv="
x - dns - prefetch - control " content="
off "> <meta name="
application - name " content="
Tumblr "> <meta name="
msapplication - TileColor " content="
#3645d"> <meta name= "msapplication-TileImage"
content = "https://assets.tumblr.com/images/msfavicon.png?_v=245323c5cb69e705ea213d9ed60e543a" > < link rel = "shortcut icon"
href = "https://assets.tumblr.com/images/favicons/favicon.ico?_v=8bfa6dd3e1249cd567350c606f8574dc"
type = "image/png" > < meta name = "p:domain_verify"
content = "d06c4fa470a9a6935c9a7b43d57eb7d2" > < link rel = "apple-touch-icon"
sizes = "57x57"
href = "https://assets.tumblr.com/images/apple-touch-icon-57x57.png?_v=81406f92242ce0166328bc17e4473e6e"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "60x60"
href = "https://assets.tumblr.com/images/apple-touch-icon-60x60.png?_v=20e3957f7027b72d5aa60085204ae63c"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "72x72"
href = "https://assets.tumblr.com/images/apple-touch-icon-72x72.png?_v=8df24181ba31066d8710f67c9a287241"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "76x76"
href = "https://assets.tumblr.com/images/apple-touch-icon-76x76.png?_v=455617cae13eff40acffac5e489bde50"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "120x120"
href = "https://assets.tumblr.com/images/apple-touch-icon-120x120.png?_v=5604f95b165810101ea055f2cb5206b9"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "128x128"
href = "https://assets.tumblr.com/images/apple-touch-icon-128x128.png?_v=fd39307925fa7f1ada28b08d67e93da1"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "144x144"
href = "https://assets.tumblr.com/images/apple-touch-icon-144x144.png?_v=dfd5b392d423c5f0278d9f498abda2fa"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "152x152"
href = "https://assets.tumblr.com/images/apple-touch-icon-152x152.png?_v=73c2019bf6a75f7e476e01ba136cebec"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "180x180"
href = "https://assets.tumblr.com/images/apple-touch-icon-180x180.png?_v=00127c0342d97d5f36cfd8aa6439ca10"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "195x195"
href = "https://assets.tumblr.com/images/apple-touch-icon-195x194.png?_v=0"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "196x196"
href = "https://assets.tumblr.com/images/apple-touch-icon-196x196.png?_v=bb4b7eef0ef8e28101acdf2f0c265cc7"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "228x228"
href = "https://assets.tumblr.com/images/apple-touch-icon-228x228.png?_v=0c7874da12e347c2bdf95e5baa3f396a"
type = "image/png" > < link rel = "canonical"
href = "https://www.tumblr.com/search/art%20anime/recent" > < meta name = "robots"
id = "robots"
content = "noodp,noydir" > < meta name = "description"
id = "description"
content = "Tumblr is a place to express yourself, discover yourself, and bond over the stuff you love. It's where your interests connect you with your people." > < meta name = "keywords"
id = "keywords"
content = "tumblelog, blog, tumblog, tumbler, tumblr, tlog, microblog" > < meta name = "viewport"
id = "viewport"
content = "width=960" > < meta name = "tumblr-form-key"
id = "tumblr_form_key"
content = "!1231553203788|mOZjoWSzPU6eNRkpuhEtzoBJmdA" > < meta name = "tumblr-gpop"
id = "tumblr_gpop"
content = "Tumblr" > < meta name = "og:title"
id = "og_title"
content = "art anime | Tumblr" > < meta name = "og:image"
id = "og_image"
content = "https://66.media.tumblr.com/06afadc2cafb6945065a4b10d61f3b45/tumblr_poqjiuUUGO1tvlw71o1_r1_500.jpg" > < script type = "application/ld+json" >


I want to get content="https://66.media.tumblr.com ... etc
link from this string and for you know the string is updating every hour



I try this way not working I result -1 and 0
on google script ( java script ) cods



function urll() var response =
UrlFetchApp.fetch("https://www.tumblr.com/search/art+anime/recent");
var str = response.getContentText(); var m=str.search('is=“og_image”
content=“(^”*)'); Logger.log(m);










share|improve this question
























  • This is the exact string you want to parse?

    – obscure
    Mar 21 at 22:10











  • yeah , how i exact ?

    – aqbal lahor
    Mar 21 at 22:13











  • Well this 'string' doesn't look like a plain string - more like html - and not really usable as a string with all those " characters in it. Where do you get it from?

    – obscure
    Mar 21 at 22:36











  • how you storing this sting content, it gives error when you put this in any variable,

    – Bhalke
    Mar 22 at 6:25













0












0








0


1






so I have this code on string:



<html class="
no - js ie ie6 lt - ie9 lt - ie8 lt - ie7 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 7]> <html class="
no - js ie ie7 lt - ie9 lt - ie8 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 8]> <html class="
no - js ie ie8 lt - ie9 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 9]> <html class="
no - js ie9 search - context en_US " lang="
en - US "> <![endif]--><!--[if gt IE 9]><!--> <html class="
no - js search - context en_US " lang="
en - US "> <!--<![endif]--> <head><title>art anime | Tumblr</title><!--[if ie]><meta http-equiv="
X - UA - Compatible " content="
IE = Edge, chrome = 1 "/><![endif]--><meta http-equiv="
Content - Type " content="
text / html;
charset = utf - 8 "> <meta http-equiv="
x - dns - prefetch - control " content="
off "> <meta name="
application - name " content="
Tumblr "> <meta name="
msapplication - TileColor " content="
#3645d"> <meta name= "msapplication-TileImage"
content = "https://assets.tumblr.com/images/msfavicon.png?_v=245323c5cb69e705ea213d9ed60e543a" > < link rel = "shortcut icon"
href = "https://assets.tumblr.com/images/favicons/favicon.ico?_v=8bfa6dd3e1249cd567350c606f8574dc"
type = "image/png" > < meta name = "p:domain_verify"
content = "d06c4fa470a9a6935c9a7b43d57eb7d2" > < link rel = "apple-touch-icon"
sizes = "57x57"
href = "https://assets.tumblr.com/images/apple-touch-icon-57x57.png?_v=81406f92242ce0166328bc17e4473e6e"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "60x60"
href = "https://assets.tumblr.com/images/apple-touch-icon-60x60.png?_v=20e3957f7027b72d5aa60085204ae63c"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "72x72"
href = "https://assets.tumblr.com/images/apple-touch-icon-72x72.png?_v=8df24181ba31066d8710f67c9a287241"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "76x76"
href = "https://assets.tumblr.com/images/apple-touch-icon-76x76.png?_v=455617cae13eff40acffac5e489bde50"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "120x120"
href = "https://assets.tumblr.com/images/apple-touch-icon-120x120.png?_v=5604f95b165810101ea055f2cb5206b9"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "128x128"
href = "https://assets.tumblr.com/images/apple-touch-icon-128x128.png?_v=fd39307925fa7f1ada28b08d67e93da1"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "144x144"
href = "https://assets.tumblr.com/images/apple-touch-icon-144x144.png?_v=dfd5b392d423c5f0278d9f498abda2fa"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "152x152"
href = "https://assets.tumblr.com/images/apple-touch-icon-152x152.png?_v=73c2019bf6a75f7e476e01ba136cebec"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "180x180"
href = "https://assets.tumblr.com/images/apple-touch-icon-180x180.png?_v=00127c0342d97d5f36cfd8aa6439ca10"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "195x195"
href = "https://assets.tumblr.com/images/apple-touch-icon-195x194.png?_v=0"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "196x196"
href = "https://assets.tumblr.com/images/apple-touch-icon-196x196.png?_v=bb4b7eef0ef8e28101acdf2f0c265cc7"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "228x228"
href = "https://assets.tumblr.com/images/apple-touch-icon-228x228.png?_v=0c7874da12e347c2bdf95e5baa3f396a"
type = "image/png" > < link rel = "canonical"
href = "https://www.tumblr.com/search/art%20anime/recent" > < meta name = "robots"
id = "robots"
content = "noodp,noydir" > < meta name = "description"
id = "description"
content = "Tumblr is a place to express yourself, discover yourself, and bond over the stuff you love. It's where your interests connect you with your people." > < meta name = "keywords"
id = "keywords"
content = "tumblelog, blog, tumblog, tumbler, tumblr, tlog, microblog" > < meta name = "viewport"
id = "viewport"
content = "width=960" > < meta name = "tumblr-form-key"
id = "tumblr_form_key"
content = "!1231553203788|mOZjoWSzPU6eNRkpuhEtzoBJmdA" > < meta name = "tumblr-gpop"
id = "tumblr_gpop"
content = "Tumblr" > < meta name = "og:title"
id = "og_title"
content = "art anime | Tumblr" > < meta name = "og:image"
id = "og_image"
content = "https://66.media.tumblr.com/06afadc2cafb6945065a4b10d61f3b45/tumblr_poqjiuUUGO1tvlw71o1_r1_500.jpg" > < script type = "application/ld+json" >


I want to get content="https://66.media.tumblr.com ... etc
link from this string and for you know the string is updating every hour



I try this way not working I result -1 and 0
on google script ( java script ) cods



function urll() var response =
UrlFetchApp.fetch("https://www.tumblr.com/search/art+anime/recent");
var str = response.getContentText(); var m=str.search('is=“og_image”
content=“(^”*)'); Logger.log(m);










share|improve this question
















so I have this code on string:



<html class="
no - js ie ie6 lt - ie9 lt - ie8 lt - ie7 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 7]> <html class="
no - js ie ie7 lt - ie9 lt - ie8 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 8]> <html class="
no - js ie ie8 lt - ie9 search - context en_US " lang="
en - US "> <![endif]--><!--[if IE 9]> <html class="
no - js ie9 search - context en_US " lang="
en - US "> <![endif]--><!--[if gt IE 9]><!--> <html class="
no - js search - context en_US " lang="
en - US "> <!--<![endif]--> <head><title>art anime | Tumblr</title><!--[if ie]><meta http-equiv="
X - UA - Compatible " content="
IE = Edge, chrome = 1 "/><![endif]--><meta http-equiv="
Content - Type " content="
text / html;
charset = utf - 8 "> <meta http-equiv="
x - dns - prefetch - control " content="
off "> <meta name="
application - name " content="
Tumblr "> <meta name="
msapplication - TileColor " content="
#3645d"> <meta name= "msapplication-TileImage"
content = "https://assets.tumblr.com/images/msfavicon.png?_v=245323c5cb69e705ea213d9ed60e543a" > < link rel = "shortcut icon"
href = "https://assets.tumblr.com/images/favicons/favicon.ico?_v=8bfa6dd3e1249cd567350c606f8574dc"
type = "image/png" > < meta name = "p:domain_verify"
content = "d06c4fa470a9a6935c9a7b43d57eb7d2" > < link rel = "apple-touch-icon"
sizes = "57x57"
href = "https://assets.tumblr.com/images/apple-touch-icon-57x57.png?_v=81406f92242ce0166328bc17e4473e6e"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "60x60"
href = "https://assets.tumblr.com/images/apple-touch-icon-60x60.png?_v=20e3957f7027b72d5aa60085204ae63c"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "72x72"
href = "https://assets.tumblr.com/images/apple-touch-icon-72x72.png?_v=8df24181ba31066d8710f67c9a287241"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "76x76"
href = "https://assets.tumblr.com/images/apple-touch-icon-76x76.png?_v=455617cae13eff40acffac5e489bde50"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "120x120"
href = "https://assets.tumblr.com/images/apple-touch-icon-120x120.png?_v=5604f95b165810101ea055f2cb5206b9"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "128x128"
href = "https://assets.tumblr.com/images/apple-touch-icon-128x128.png?_v=fd39307925fa7f1ada28b08d67e93da1"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "144x144"
href = "https://assets.tumblr.com/images/apple-touch-icon-144x144.png?_v=dfd5b392d423c5f0278d9f498abda2fa"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "152x152"
href = "https://assets.tumblr.com/images/apple-touch-icon-152x152.png?_v=73c2019bf6a75f7e476e01ba136cebec"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "180x180"
href = "https://assets.tumblr.com/images/apple-touch-icon-180x180.png?_v=00127c0342d97d5f36cfd8aa6439ca10"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "195x195"
href = "https://assets.tumblr.com/images/apple-touch-icon-195x194.png?_v=0"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "196x196"
href = "https://assets.tumblr.com/images/apple-touch-icon-196x196.png?_v=bb4b7eef0ef8e28101acdf2f0c265cc7"
type = "image/png" > < link rel = "apple-touch-icon"
sizes = "228x228"
href = "https://assets.tumblr.com/images/apple-touch-icon-228x228.png?_v=0c7874da12e347c2bdf95e5baa3f396a"
type = "image/png" > < link rel = "canonical"
href = "https://www.tumblr.com/search/art%20anime/recent" > < meta name = "robots"
id = "robots"
content = "noodp,noydir" > < meta name = "description"
id = "description"
content = "Tumblr is a place to express yourself, discover yourself, and bond over the stuff you love. It's where your interests connect you with your people." > < meta name = "keywords"
id = "keywords"
content = "tumblelog, blog, tumblog, tumbler, tumblr, tlog, microblog" > < meta name = "viewport"
id = "viewport"
content = "width=960" > < meta name = "tumblr-form-key"
id = "tumblr_form_key"
content = "!1231553203788|mOZjoWSzPU6eNRkpuhEtzoBJmdA" > < meta name = "tumblr-gpop"
id = "tumblr_gpop"
content = "Tumblr" > < meta name = "og:title"
id = "og_title"
content = "art anime | Tumblr" > < meta name = "og:image"
id = "og_image"
content = "https://66.media.tumblr.com/06afadc2cafb6945065a4b10d61f3b45/tumblr_poqjiuUUGO1tvlw71o1_r1_500.jpg" > < script type = "application/ld+json" >


I want to get content="https://66.media.tumblr.com ... etc
link from this string and for you know the string is updating every hour



I try this way not working I result -1 and 0
on google script ( java script ) cods



function urll() var response =
UrlFetchApp.fetch("https://www.tumblr.com/search/art+anime/recent");
var str = response.getContentText(); var m=str.search('is=“og_image”
content=“(^”*)'); Logger.log(m);







javascript string






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 6:19









wscourge

8,01482955




8,01482955










asked Mar 21 at 22:02









aqbal lahoraqbal lahor

177




177












  • This is the exact string you want to parse?

    – obscure
    Mar 21 at 22:10











  • yeah , how i exact ?

    – aqbal lahor
    Mar 21 at 22:13











  • Well this 'string' doesn't look like a plain string - more like html - and not really usable as a string with all those " characters in it. Where do you get it from?

    – obscure
    Mar 21 at 22:36











  • how you storing this sting content, it gives error when you put this in any variable,

    – Bhalke
    Mar 22 at 6:25

















  • This is the exact string you want to parse?

    – obscure
    Mar 21 at 22:10











  • yeah , how i exact ?

    – aqbal lahor
    Mar 21 at 22:13











  • Well this 'string' doesn't look like a plain string - more like html - and not really usable as a string with all those " characters in it. Where do you get it from?

    – obscure
    Mar 21 at 22:36











  • how you storing this sting content, it gives error when you put this in any variable,

    – Bhalke
    Mar 22 at 6:25
















This is the exact string you want to parse?

– obscure
Mar 21 at 22:10





This is the exact string you want to parse?

– obscure
Mar 21 at 22:10













yeah , how i exact ?

– aqbal lahor
Mar 21 at 22:13





yeah , how i exact ?

– aqbal lahor
Mar 21 at 22:13













Well this 'string' doesn't look like a plain string - more like html - and not really usable as a string with all those " characters in it. Where do you get it from?

– obscure
Mar 21 at 22:36





Well this 'string' doesn't look like a plain string - more like html - and not really usable as a string with all those " characters in it. Where do you get it from?

– obscure
Mar 21 at 22:36













how you storing this sting content, it gives error when you put this in any variable,

– Bhalke
Mar 22 at 6:25





how you storing this sting content, it gives error when you put this in any variable,

– Bhalke
Mar 22 at 6:25












2 Answers
2






active

oldest

votes


















2














Use jquery to grab it. Per your example above, there is a unique id of og_image, so use that to get the meta element, then narrow it down to the content attribute.



$("meta #og_image").attr("content");


Assuming you already have that whole mess in a single variable myString:



var regex = /66.[^"]*/;
var myLink = myString.match(regex);


myLink[0] will be the url.



To make this answer a bit more useful for other similar situations rather than just this niche case, if you're trying to pull a link out of a long string like this that contains many, you can use:



var regex = /http[^"]*/g;
var links = myString.match(regex);


That will give you an array of all the links.



links[links.length-1];


Will be the last one, which is what you want in this case.






share|improve this answer

























  • but the problem this is cod is "string"

    – aqbal lahor
    Mar 21 at 22:32






  • 1





    Added the javascript regex to parse out just the url from this "string" if you already have it in a variable.

    – Peter
    Mar 21 at 22:41











  • thank you its work <3

    – aqbal lahor
    Mar 21 at 22:43


















0














You can use regular expression like ‘is=“og_image” content=“(^”*)’ it will take every content url
If you need only last one, you can add the id parameter validation also






share|improve this answer

























  • I don't know how add parameter validation, can you give example

    – aqbal lahor
    Mar 21 at 22:30











  • I’ve updated my code. If you’ll need more details I can make the whole code sample later

    – Alexey Zelenin
    Mar 21 at 22:32











  • jQuery sample will work - you just need to initialize the object with your string. Same way you use to create new html elements to be added to the page.

    – Alexey Zelenin
    Mar 21 at 22:39











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55289933%2fjava-script-extract-link-from-string%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Use jquery to grab it. Per your example above, there is a unique id of og_image, so use that to get the meta element, then narrow it down to the content attribute.



$("meta #og_image").attr("content");


Assuming you already have that whole mess in a single variable myString:



var regex = /66.[^"]*/;
var myLink = myString.match(regex);


myLink[0] will be the url.



To make this answer a bit more useful for other similar situations rather than just this niche case, if you're trying to pull a link out of a long string like this that contains many, you can use:



var regex = /http[^"]*/g;
var links = myString.match(regex);


That will give you an array of all the links.



links[links.length-1];


Will be the last one, which is what you want in this case.






share|improve this answer

























  • but the problem this is cod is "string"

    – aqbal lahor
    Mar 21 at 22:32






  • 1





    Added the javascript regex to parse out just the url from this "string" if you already have it in a variable.

    – Peter
    Mar 21 at 22:41











  • thank you its work <3

    – aqbal lahor
    Mar 21 at 22:43















2














Use jquery to grab it. Per your example above, there is a unique id of og_image, so use that to get the meta element, then narrow it down to the content attribute.



$("meta #og_image").attr("content");


Assuming you already have that whole mess in a single variable myString:



var regex = /66.[^"]*/;
var myLink = myString.match(regex);


myLink[0] will be the url.



To make this answer a bit more useful for other similar situations rather than just this niche case, if you're trying to pull a link out of a long string like this that contains many, you can use:



var regex = /http[^"]*/g;
var links = myString.match(regex);


That will give you an array of all the links.



links[links.length-1];


Will be the last one, which is what you want in this case.






share|improve this answer

























  • but the problem this is cod is "string"

    – aqbal lahor
    Mar 21 at 22:32






  • 1





    Added the javascript regex to parse out just the url from this "string" if you already have it in a variable.

    – Peter
    Mar 21 at 22:41











  • thank you its work <3

    – aqbal lahor
    Mar 21 at 22:43













2












2








2







Use jquery to grab it. Per your example above, there is a unique id of og_image, so use that to get the meta element, then narrow it down to the content attribute.



$("meta #og_image").attr("content");


Assuming you already have that whole mess in a single variable myString:



var regex = /66.[^"]*/;
var myLink = myString.match(regex);


myLink[0] will be the url.



To make this answer a bit more useful for other similar situations rather than just this niche case, if you're trying to pull a link out of a long string like this that contains many, you can use:



var regex = /http[^"]*/g;
var links = myString.match(regex);


That will give you an array of all the links.



links[links.length-1];


Will be the last one, which is what you want in this case.






share|improve this answer















Use jquery to grab it. Per your example above, there is a unique id of og_image, so use that to get the meta element, then narrow it down to the content attribute.



$("meta #og_image").attr("content");


Assuming you already have that whole mess in a single variable myString:



var regex = /66.[^"]*/;
var myLink = myString.match(regex);


myLink[0] will be the url.



To make this answer a bit more useful for other similar situations rather than just this niche case, if you're trying to pull a link out of a long string like this that contains many, you can use:



var regex = /http[^"]*/g;
var links = myString.match(regex);


That will give you an array of all the links.



links[links.length-1];


Will be the last one, which is what you want in this case.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 21 at 22:48

























answered Mar 21 at 22:27









PeterPeter

3,19312336




3,19312336












  • but the problem this is cod is "string"

    – aqbal lahor
    Mar 21 at 22:32






  • 1





    Added the javascript regex to parse out just the url from this "string" if you already have it in a variable.

    – Peter
    Mar 21 at 22:41











  • thank you its work <3

    – aqbal lahor
    Mar 21 at 22:43

















  • but the problem this is cod is "string"

    – aqbal lahor
    Mar 21 at 22:32






  • 1





    Added the javascript regex to parse out just the url from this "string" if you already have it in a variable.

    – Peter
    Mar 21 at 22:41











  • thank you its work <3

    – aqbal lahor
    Mar 21 at 22:43
















but the problem this is cod is "string"

– aqbal lahor
Mar 21 at 22:32





but the problem this is cod is "string"

– aqbal lahor
Mar 21 at 22:32




1




1





Added the javascript regex to parse out just the url from this "string" if you already have it in a variable.

– Peter
Mar 21 at 22:41





Added the javascript regex to parse out just the url from this "string" if you already have it in a variable.

– Peter
Mar 21 at 22:41













thank you its work <3

– aqbal lahor
Mar 21 at 22:43





thank you its work <3

– aqbal lahor
Mar 21 at 22:43













0














You can use regular expression like ‘is=“og_image” content=“(^”*)’ it will take every content url
If you need only last one, you can add the id parameter validation also






share|improve this answer

























  • I don't know how add parameter validation, can you give example

    – aqbal lahor
    Mar 21 at 22:30











  • I’ve updated my code. If you’ll need more details I can make the whole code sample later

    – Alexey Zelenin
    Mar 21 at 22:32











  • jQuery sample will work - you just need to initialize the object with your string. Same way you use to create new html elements to be added to the page.

    – Alexey Zelenin
    Mar 21 at 22:39















0














You can use regular expression like ‘is=“og_image” content=“(^”*)’ it will take every content url
If you need only last one, you can add the id parameter validation also






share|improve this answer

























  • I don't know how add parameter validation, can you give example

    – aqbal lahor
    Mar 21 at 22:30











  • I’ve updated my code. If you’ll need more details I can make the whole code sample later

    – Alexey Zelenin
    Mar 21 at 22:32











  • jQuery sample will work - you just need to initialize the object with your string. Same way you use to create new html elements to be added to the page.

    – Alexey Zelenin
    Mar 21 at 22:39













0












0








0







You can use regular expression like ‘is=“og_image” content=“(^”*)’ it will take every content url
If you need only last one, you can add the id parameter validation also






share|improve this answer















You can use regular expression like ‘is=“og_image” content=“(^”*)’ it will take every content url
If you need only last one, you can add the id parameter validation also







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 21 at 22:31

























answered Mar 21 at 22:24









Alexey ZeleninAlexey Zelenin

1015




1015












  • I don't know how add parameter validation, can you give example

    – aqbal lahor
    Mar 21 at 22:30











  • I’ve updated my code. If you’ll need more details I can make the whole code sample later

    – Alexey Zelenin
    Mar 21 at 22:32











  • jQuery sample will work - you just need to initialize the object with your string. Same way you use to create new html elements to be added to the page.

    – Alexey Zelenin
    Mar 21 at 22:39

















  • I don't know how add parameter validation, can you give example

    – aqbal lahor
    Mar 21 at 22:30











  • I’ve updated my code. If you’ll need more details I can make the whole code sample later

    – Alexey Zelenin
    Mar 21 at 22:32











  • jQuery sample will work - you just need to initialize the object with your string. Same way you use to create new html elements to be added to the page.

    – Alexey Zelenin
    Mar 21 at 22:39
















I don't know how add parameter validation, can you give example

– aqbal lahor
Mar 21 at 22:30





I don't know how add parameter validation, can you give example

– aqbal lahor
Mar 21 at 22:30













I’ve updated my code. If you’ll need more details I can make the whole code sample later

– Alexey Zelenin
Mar 21 at 22:32





I’ve updated my code. If you’ll need more details I can make the whole code sample later

– Alexey Zelenin
Mar 21 at 22:32













jQuery sample will work - you just need to initialize the object with your string. Same way you use to create new html elements to be added to the page.

– Alexey Zelenin
Mar 21 at 22:39





jQuery sample will work - you just need to initialize the object with your string. Same way you use to create new html elements to be added to the page.

– Alexey Zelenin
Mar 21 at 22:39

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55289933%2fjava-script-extract-link-from-string%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현