3007 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+7 more
duotive says
Wierd outcome…..
Array ( [0] => Array ( [0] => http://www.example.com/images/image1.jpg [1] => http://www.example.com/images/image2.jpg [2] => http://www.example.com/images/image3.jpg [3] => http://example.com/images/image4.jpg ) [1] => Array ( [0] => www.example.com [1] => www.example.com [2] => www.example.com [3] => example.com ) [2] => Array ( [0] => [1] => [2] => [3] => ) [3] => Array ( [0] => /images/image1.jpg [1] => /images/image2.jpg [2] => /images/image3.jpg [3] => /images/image4.jpg ) [4] => Array ( [0] => images/image1.jpg [1] => images/image2.jpg [2] => images/image3.jpg [3] => images/image4.jpg ) [5] => Array ( [0] => [1] => [2] => [3] => ) ) 
The problem is that this will be used for shortcodes… and lovely wordpress adds extra characters that we do not need…. that is why i was looking for regular expressions. If i only knew them…. but i find them wierd… lots of text that dose something…. never understood them.
2184 posts
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
  • Interviewed on an Envato blog
+10 more
revaxarts says

looks weird but isn’t ;)

  1. first array is an array all your urls (what you need)
  2. second array is an array with just the domains
  3. fourth array is an array with the paths
all arrays representing the content within the brackets:
          2st        3nd   5th4rd      6th
https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?

the first array is the whole pattern

2184 posts
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
  • Interviewed on an Envato blog
+10 more
revaxarts says

the third array should be the port

the 6th should be the query string

3007 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+7 more
duotive says

thanks.

3503 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says


Can’t you just use the explode() function?
$urls = explode("\n", $url_str);
=)))) too simple to work but it did =)))) if anyone knows a regular than can do this it will be amazing, but in the time being this is very good. THANKS !!

No problem – glad it gets you going for the time being at least :)

701 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Located in Canada
  • Has collected more than 1000 items on Envato Market
chrismccoy says

thanks.
/<img.*?src="(.*?)".*?(/>|)/gi

should work for just the img/

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by