I want to use it to add a P-Asserted-Identity header
Something like this may work?
set private-variable MatchedURI header From position first match-value /.*(<sip:541[0-9]{7}@[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}>).*/ new-value /\1/
Note: I haven't had any need to rewrite headers within AOS as that's something I would do on our SBC.
For reference: https://supportforums.adtran.com/servlet/JiveServlet/previewBody/5041-102-2-5478/6AOSCG0026-29A.pdf