AppleScript: How to extract section from string (based on defined characters)? Example:

set theText to "I ate an apple at 11:54 pm without the skin."

I would like theTime to be a string that contains the text: 11:54

So, I would like the opening text item delimiter to be at_ and the closing text item delimiter to be either _pm or _am, depending on which period exists in the string. (Note - Every instance of an underscore in this post is meant to represent a space because I am unable to represent a space in the Stack Exchange code formatting.)

The contents of theText will vary greatly. For example, it might be:

set theText to "I ate two navel oranges at 6:30 am with a glass of water." 

But the time format will always remain constant. The time will always be preceded with an "at " and that "at " will always be the first instance of an "at " in the string. Similarly, the time will necessarily be followed by either " am" or " pm".
You can do it with pure AppleScript, even though the shell script method presented above is very nice:

set theText to "I ate an apple at 11:54 pm without the skin."
set the_colon_location to offset of ":" in theText
-- now we know where the colon is.
-- The Time is going to be on either side of it.
set the_starting_point to the_colon_location - 2
set the_ending_point to the_colon_location + 5
set the_time_string to characters the_starting_point thru the_ending_point of theText as string
-- in case the hour is not two digits, the first character will be a space
if character 1 of the_time_string is " " then
    set the_time_string to characters 2 thru -1 of the_time_string as string
end if
return the_time_string