@Sonny CheeIf you are trying to replace the value then you can do that by using Replace Text processor instead of ExtractText processor.
Extract text processor extracts the contents of flowfile for the matching regex and keep the extracted contents as the attributes of the flowfile.
Example:-
If you are trying to find all matches for ${key_name}\s*:(\s*.+\n) in the flowfile and then replace the matches with ${key_value)
Then replacetext processor configs:-
