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

Fwd: Regex with Satimage


  • Subject: Fwd: Regex with Satimage
  • From: Michael Ghilissen <email@hidden>
  • Date: Mon, 6 Jun 2005 03:37:25 -0400

Thanks Jean-Baptiste for the suggestion. I will try. Meanwhile, I still would like to resolve the regex problem, despite Tim's suggestion. It puzzles me.

Michael Ghilissen

On Jun 6, 2005, at 2:53 AM, Le Stang Jean-Baptiste wrote:

 Since you are not an afraid-of-all-those-osax scripter, what about giving a try to theXMLLib osax? RegEx seems no to be very adapted to searching&working in a XML document. 

++ Jean-Baptiste

On Jun 5, 2005, at 11:47 PM, Michael Ghilissen wrote:

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
 _______________________________________________
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

  • Prev by Date: Re: Regex with Satimage
  • Next by Date: Re: URL wrapping [was: Re: Change Character]
  • Previous by thread: Re: Regex with Satimage
  • Next by thread: Re: Regex with Satimage
  • Index(es):
    • Date
    • Thread