I'm new to Regex. I'm trying to scan few text file and get some field name based on Tag Field and Action. I'm using Powershell and regex = ?smi)\b(field|Action)[^)]+ to get the full Field and action String. Once i get the string now to get the value from field and action string i call (?<=;).* However it fails (wrong value) on line Field("Waiting Period (H)"; "Waiting Period (Hrs.)") { } . Please note the Value can be in Quote or no Quote however it will always end with this ) the problem is some field name can have e.g (Hrs.)")
{
group("Default")
{
Field("Postal Code"; **Postal**)
{
ToolTip = 'Enter Postal Code ';
trigger OnValidate()
begin
If ("Postal Code" <> xRec."Postal Code.") then
function()
END;
}
field ("Cels or Fahr"; **"Celsius or Fahrenheit"**) {
ToolTip = 'Enter temperature ';
}
Field("Waiting Period (H)"; **"Waiting Period (Hrs.)"**) { }
Field ( Latitude; **Latitude**)
{
ToolTip = 'Enter Latitude';
trigger OnValidate()
}
}
}
action(**"Restore to Default"**)
{
ToolTip = 'Enter Latitude';
}
I'm looking for output for tag "Field Or Action" to return these values below Postal "Celsius or Fahrenheit" "Waiting Period (Hrs.)" Latitude "Restore to Default"
So, If i use https://regex101.com/ on the same text (?<=;).* the text is "Waiting Period (Hrs.)") { } is wrong "Waiting Period (Hrs.)") { } . Any help or advice will be helpful.
(?smi)\b(field|Action)[^{]+( note[^{]+instead of[^)]+).