Jump to content

[SOLVED] Small string..can't get the right combo to pull it in.


Recommended Posts

#<a href="(/[a-z]{3}/\d{10}\.html)">#

 

# - opening delimiter

<a href=" - literal string ie find this exact pattern

( - start a new capture group

/ - literal forward slash (as all the links start with a forward slash)

[a-z]{3} - 3 letters

/ - literal forward slash

\d{10} - a 10 digit number

\. - a full stop character (the backslash escapes it as it is a special character)

html - another literal string

) - close capture group

"> - yet more literal characters

# - ending delimiter

 

Wow..finally explained the way i can understand it- Thank You!

If you set $url = "http://newjersey.craigslist.org/sss/"; before calling file_get_contents($url); it should do pretty much the same as the curl approach with substantially less code.

 

Do you use Curl? Can PHP do the same tasks as Curl?

 

I''m still a newbie and wondering if i should even concern myself with curl or stick with php?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.