regular expressions:
"/animation(\d+)/"
This expression will return the number as a string, convert it to int
[quote:3uaopvwy]RegexMatchAt(String, Regex, Flags, Index)
Process the regular expression Regex on String with Flags, and in the list of results, return the entry at Index.
myString = "animation2"
int(RegexMatchAt(myString, "/animation(\d+)/", "", 0))