![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Dec 2003
Location: 1123,6536,5231
Posts: 3,397
|
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! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
This is probably too greedy of a regex, but you can try:
preg_match("/src=\".*image.jpg\"/",$source,$matched);
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Jan 2003
Location: Nomad Land
Posts: 1,629
|
/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.
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
making it rain
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,119
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Dec 2003
Location: 1123,6536,5231
Posts: 3,397
|
Man I am getting good, I was just missing a "."
Thanks for the help guys, I appreciate it. |
![]() |
![]() ![]() ![]() ![]() ![]() |