I figured it out - Here is the answer for anyone who might need it.
SEDCMD-testdata_anonymizer = s/(.*)<testfield>[\s\S]*?<\/testfield>.*/\1 <testfield>xxxx<\/testfield>/g
... View more
You can modify the regex to capture only the next three digits after 'testfield:' this way:
REGEX = (?m)testfield:\s+(\d{3})
FORMAT = testfield:\sxxxx
This will capture any string 'testfield:' followed by a space and three digits.
... View more