Note: If using a version of Apache NiFi 1.3.0+, Matt's way is better
My recommendation would be to use an ExecuteScript processor and use Groovy to do this. I believe you could eventually craft a regular expression which would match what you are looking for, but as you note, the performance is not going to be good, and if a larger flowfile came in, you may crash the heap.
In Groovy (or Python/Ruby/etc.), this would be a simple string replacement operation like so:
import org.apache.commons.io.IOUtils
import java.nio.charset.*
def flowFile = session.get()
if(!flowFile) return
flowFile = session.write(flowFile, {inputStream, outputStream ->
def elements = IOUtils.toString(inputStream, StandardCharsets.UTF_8).split(",")
// Rather than hardcoding, you could make the column index also read from a flowfile attribute to make this more generic
elements[2] = flowfile.getAttribute("myAttributeName")
def outputString = elements.join(",")
outputStream.write(outputString.getBytes(StandardCharsets.UTF_8))
} as StreamCallback)
session.transfer(flowFile, REL_SUCCESS)