Your pattern won't do what you think it does. It will match a single A, n, y or 1 character, followed by a literal _from, followed by a single A, n, y or 2 character. The start (^) and end ($) anchors around your string will also ensure the entire string must match the pattern, and not just a substring.
Perhaps you want a pattern like this:
^(.*)_from([^_]*)
This will match zero or more of any character, captured in group 1, followed by a literal _from, followed by zero or more of any character other than underscores, captured in group 2. It will also allow any other characters to follow the matched substring.
Or possibly this:
^([^_]*)_from([^_]*)
This will match zero or more of any character other than underscores, captured in group 1, followed by a literal _from, followed by zero or more of any character other than underscores, captured in group 2. It will also allow any other characters to follow the matched substring.