• 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
Regex with Satimage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regex with Satimage


  • Subject: Regex with Satimage
  • From: Michael Ghilissen <email@hidden>
  • Date: Sun, 5 Jun 2005 17:47:21 -0400

Hello,

I hope to read the pairs <tile> and <description> from a web page, extract the text between the XML tags and set the text to 'references' \2 and \6, using Satimage's Find Text with regex.

The following code returns no match. But if I break the condition and look for <title> or <description> separately using only one reference, the match works. If I join the two conditions with an unlimited sequence of characters (.*), it fails.

Can some one show me how to deal with this situation?

Thanks much,

Michael Ghilissen

==== Code Here====

set theText to "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<rss version=\"2.0\">
<channel>
<title>Top Headlines from World Press Review</title>
<link>http://www.worldpress.org</link>
<description>World News Review</description>
<language>en-us</language>
<copyright>Copyright 2005, worldpress.org. All Rights Reserved</copyright>
<managingEditor>email@hidden</managingEditor>
<webMaster>email@hidden</webMaster>
<image>
<url>http://www.worldpress.org/images/objects/20050604-moro-islamic-liber.jpg</url>
<title>Top Headlines from World Press Review</title>
<link>http://www.worldpress.org</link>
</image>
<item>
<title>Mindanao the New Afghanistan Says Ambassador</title>
<link> http://www.worldpress.org/Asia/2093.cfm</link>
<description> In a statement made on Australian television in early May, the acting United States ambassador to the Philippines has described Mindanao, the countrys second largest island, as the worlds new terrorist &#x93;Mecca,&#x94; comparing it to Afghanistan.</description>
<pubDate>Sat, 04 Jun 2005 18:50:00 GMT</pubDate>
</item>"

set theResult to find text "(<title>)(.*)(<)(.*)(<description>)(.*)(<)" in theText using {"Title: \\2 ", "Description: \\6"} with regexp, all occurrences and string result

return theResult
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Regex with Satimage
      • From: Le Stang Jean-Baptiste <email@hidden>
    • Re: Regex with Satimage
      • From: tim <email@hidden>
  • Prev by Date: Re: Classic environment startup/shutdown
  • Next by Date: Re: Regex with Satimage
  • Previous by thread: Re: Question on old software
  • Next by thread: Re: Regex with Satimage
  • Index(es):
    • Date
    • Thread