Try pm list packages -f | grep -o "system/app/[a-zA-Z]*"
Match literally system/app/ and any lowercase letter a through z plus any uppercase letter A through Z repeated unlimited times. Will match up to, but not including the slash character.
You can use bracket notation to include numbers as well, if needed. I'll leave that as an exercise for you.
Hint: this is actually using regular expression (regEx) matching with grep.
I would of gone with a "cut" which can simply remove the last character.