Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

i have an string variable with links inside (among other text), and i want to be able to extract all links containing a certain patron (like containing the word 'case')... is this possible to do?

Variable string is something like:

var string = 'here is some text line among the ones there will be links like httphttps://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more';

As a workaround, i used what described here: extract links from documentextract links from document, to create a document with the string as content and then extract the links, but i would like to do it directly...

Regards,

EDIT (To Ruben):

If i use:

var string = 'http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html here is some text line among the ones there will be links like httphttps://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more ';

I got only the first link twice (see screenshot here).

And if i use:

var string = 'here is some text line among the ones there will be links like httphttps://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html ';

The same again (see screenshoot here).

i have an string variable with links inside (among other text), and i want to be able to extract all links containing a certain patron (like containing the word 'case')... is this possible to do?

Variable string is something like:

var string = 'here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more';

As a workaround, i used what described here: extract links from document, to create a document with the string as content and then extract the links, but i would like to do it directly...

Regards,

EDIT (To Ruben):

If i use:

var string = 'http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more ';

I got only the first link twice (see screenshot here).

And if i use:

var string = 'here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html ';

The same again (see screenshoot here).

i have an string variable with links inside (among other text), and i want to be able to extract all links containing a certain patron (like containing the word 'case')... is this possible to do?

Variable string is something like:

var string = 'here is some text line among the ones there will be links like https://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more';

As a workaround, i used what described here: extract links from document, to create a document with the string as content and then extract the links, but i would like to do it directly...

Regards,

EDIT (To Ruben):

If i use:

var string = 'http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html here is some text line among the ones there will be links like https://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more ';

I got only the first link twice (see screenshot here).

And if i use:

var string = 'here is some text line among the ones there will be links like https://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html ';

The same again (see screenshoot here).

added 884 characters in body
Source Link
kurokirasama
  • 787
  • 1
  • 10
  • 33

i have an string variable with links inside (among other text), and i want to be able to extract all links containing a certain patron (like containing the word 'case')... is this possible to do?

Variable string is something like:

var string = 'here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more';

As a workaround, i used what described here: extract links from document, to create a document with the string as content and then extract the links, but i would like to do it directly...

Regards,

EDIT (To Ruben):

If i use:

var string = 'http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more ';

I got only the first link twice (see screenshot here).

And if i use:

var string = 'here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html ';

The same again (see screenshoot here).

i have an string variable with links inside (among other text), and i want to be able to extract all links containing a certain patron (like containing the word 'case')... is this possible to do?

Variable string is something like:

var string = 'here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more';

As a workaround, i used what described here: extract links from document, to create a document with the string as content and then extract the links, but i would like to do it directly...

Regards,

i have an string variable with links inside (among other text), and i want to be able to extract all links containing a certain patron (like containing the word 'case')... is this possible to do?

Variable string is something like:

var string = 'here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more';

As a workaround, i used what described here: extract links from document, to create a document with the string as content and then extract the links, but i would like to do it directly...

Regards,

EDIT (To Ruben):

If i use:

var string = 'http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more ';

I got only the first link twice (see screenshot here).

And if i use:

var string = 'here is some text line among the ones there will be links like http://stackoverflow.com/questions/40725199/extract-all-links-from-a-string-with-google-app-script?noredirect=1#comment68679843_40725199 and more http://mangafox.me/manga/tales_of_demons_and_gods/c105/1.html ';

The same again (see screenshoot here).

Edited tags.
Link
Wicket
  • 39.4k
  • 9
  • 81
  • 201
added 270 characters in body
Source Link
kurokirasama
  • 787
  • 1
  • 10
  • 33
Loading
Source Link
kurokirasama
  • 787
  • 1
  • 10
  • 33
Loading