You could probably use Stream profiles for that. It replaces a string with another string. See https://support.f5.com/csp/article/K39394712 . If you use HTTPS you need to decrypt the traffic (use clientssl profile) and also attach HTML profile so BIGIP understands HTML and can modify it. The built-in html profile works fine, just add it in the VS settings.
Stream profiles in its simplest form: you just put in the original string and the replacement string in two fields, and attach that profile to the VS. You can however make more advanced settings as well, like multiple replacements in the same stream profile. Look under Local Traffic > Profiles > Other > Stream
iRules will also solve your problem, but Stream profiles are probably easier.