JSFiddle - React, Tailwind, and code Playground
HTML
<div>Note: jQuery used only for ease of creating event handlers.</div><br>
<input type="text" size="60" value='if a long field name 123 equals "Test String" then Show'><br>
<button>Test</button>
<div id="results"></div>
JavaScript
$("button").click(function() {
var matches = $("input").val().match(/^if\s+([\w\s]+)\s+equals\s+"([\w\s]*)"\s+then\s+(\w*)$/);
if (matches)
$("#results").html("Field: " + matches[1]
+ "<br>Value: " + matches[2]
+ "<br>Operation: " + matches[3]);
else
$("#results").html("Invalid expression");
});