Re: Simple text question
Re: Simple text question
- Subject: Re: Simple text question
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 7 Jul 2008 16:54:33 -0400
> the word "[F]" can be any word
... but it has to be in square brackets, right?
> The number can be 1,2,3 or 4 digits long.
There's always brute force:
et a to "gibberish 30[Foobazoo]this is test (#1)."
set final to offset of "]" in a
set found to false
if final is not 0 then
set initial to final - 1
repeat while initial > 1 and text initial of a is not "["
set initial to initial - 1
end repeat
if text initial of a is "[" then
repeat while initial > 1
set ch to text (initial - 1) of a
if ch >= "0" and ch <= "9" then
set found to true
set initial to initial - 1
else
exit repeat
end if
end repeat
end if
if found then
return text initial through final of a
else
return the missing value
end
_______________________________________________
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