Created 02-19-2019 07:44 AM
Hi,
Am trying to replace all characters after ";" including ; in the flowfile record.
I was using replacetext processor with ;.*$ as the search value and set empty value for Replacement value properties to achieve this. However it is not working out.
Any inputs in this regard would be really helpful.
Example:
Input
Replace;text;processor
Expected Output:
Replace
Thanks,
Bala.
Created on 02-19-2019 02:15 PM - edited 08-17-2019 05:03 PM
I would recommend using capture groups in your regex. Here is an example that will work for your example:
I then replace with just the value from capture group 1
-
Here is another example that is more generic (can have many ";<somevalue>" after first one:
Here again I use capture group 1 as my replacement value.
-
Thank you,
Matt
-
If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link
Created on 02-19-2019 02:15 PM - edited 08-17-2019 05:03 PM
I would recommend using capture groups in your regex. Here is an example that will work for your example:
I then replace with just the value from capture group 1
-
Here is another example that is more generic (can have many ";<somevalue>" after first one:
Here again I use capture group 1 as my replacement value.
-
Thank you,
Matt
-
If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link
Created 02-19-2019 06:05 PM
Thanks @Matt Clarke. I went with the option 2 and it worked. Thanks again for the quick reply.