• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
SatImage regexp problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SatImage regexp problem


  • Subject: SatImage regexp problem
  • From: Brennan <email@hidden>
  • Date: Sat, 11 Oct 2008 14:09:36 +0200

Hi,

I'm trying to extract a bunch of image links from some (generated and
well-formed) html code. I am only interested in the src parameter of a
tags.

In Smile, I was able to get a working regexp in the Find dialog, namely:

<a href="[^ ]*

When I use this in my AppleScript (escaping the ", of course), it tells me
that no result was returned. i.e.:

set txt to return & "<a
href='http://www.vegetables.com/2008/09/rhubarb.jpg'>rhubarb</a>"

set searchTerm to "href=[\"'][^ ]* "

find text searchTerm in txt with all occurrences without case sensitive

My thinking in the regexp is:

Literal href= followed by either " or ', followed by any number of
characters which are not spaces, followed by a space. What am I doing
wrong?

Alternatively, if anyone has a nice AppleScript way of extracting urls
from html, please let me know, thanks!

--
Brennan Young

"A hen is only an egg's way of making another egg."

- Samuel Butler
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: SatImage regexp problem
      • From: email@hidden
  • Prev by Date: Re: Detecting Applescript and SKYPE - MORE
  • Next by Date: Re: SatImage regexp problem
  • Previous by thread: Re: Detecting Applescript and SKYPE - MORE
  • Next by thread: Re: SatImage regexp problem
  • Index(es):
    • Date
    • Thread