GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Regex and preg experts please (https://gfy.com/showthread.php?t=681588)

BradM 11-28-2006 02:37 PM

Regex and preg experts please
 
Guys I am trying to use preg to pull a string in.
The string starts with src=" and ends with image.jpg

The middle is variable. I need to pull the entire string using the start and end of it from a page I am fopen-ing. This page is stored in a string. So I have the data here but it's a full html page. So I am going into $source, and I am trying to pull that specific string.

Anyone have some suggestions? It would be a snap if I knew what the middle of the string was, but it's *.

Thanks!

psili 11-28-2006 02:45 PM

This is probably too greedy of a regex, but you can try:

preg_match("/src=\".*image.jpg\"/",$source,$matched);

natkejs 11-28-2006 02:54 PM

/src\=\"(.*?)image\.jpg/isU

yes? no? maybe?

I dunno I suck at that shit and I didn't try that expression but it should be somewhere in the neighbourhood of what you're looking for at least.

fuzebox 11-28-2006 02:59 PM

Quote:

Originally Posted by natkejs (Post 11409768)
/src\=\"(.*?)image\.jpg/isU

yes? no? maybe?

I dunno I suck at that shit and I didn't try that expression but it should be somewhere in the neighbourhood of what you're looking for at least.

Looks right to me :thumbsup

BradM 11-28-2006 05:59 PM

Man I am getting good, I was just missing a "."
Thanks for the help guys, I appreciate it.


All times are GMT -7. The time now is 06:40 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123