I have a requirement for which I am trying to find a regex pattern to replace the code. I understand that I can get normal regular expression for finding and replacing the text however reqirement is to find and replace the instance alternatively.
For example,
{code}
UPDATE tenants SET end_user_uuid = '32392464c8a19a15dd8dc982ae3d574b' WHERE end_user_uuid = '9e194bfeace6c2d17cc71cc15e84f93a' AND instance_id = '265358' AND domain = 'automobieljansen';
{code}
Rollback:
{code}
UPDATE tenants SET end_user_uuid = '9e194bfeace6c2d17cc71cc15e84f93a' WHERE end_user_uuid = '32392464c8a19a15dd8dc982ae3d574b' AND instance_id = '265358' AND domain = 'automobieljansen';
{code}
This is the original text. I need to replace the first instance of the {code}
to <pre>
and the second instance of the {code}
to </pre>
Expected result
<pre>
UPDATE tenants SET end_user_uuid = '32392464c8a19a15dd8dc982ae3d574b' WHERE end_user_uuid = '9e194bfeace6c2d17cc71cc15e84f93a' AND instance_id = '265358' AND domain = 'automobieljansen';
</pre>
Rollback:
<pre>
UPDATE tenants SET end_user_uuid = '9e194bfeace6c2d17cc71cc15e84f93a' WHERE end_user_uuid = '32392464c8a19a15dd8dc982ae3d574b' AND instance_id = '265358' AND domain = 'automobieljansen';
</pre>
Any help on how to do this easily?