CoreBOSBB
A regular expression to assert Workflow expressions - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18)
+--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4)
+--- Thread: A regular expression to assert Workflow expressions (/showthread.php?tid=1268)



A regular expression to assert Workflow expressions - Guido1982 - 09-21-2018

Just for fun I wrote a regular expression that would assert and capture a vtlib expression in 'normal' and 'poorly' written formats. I also tested some deliberately wrong formatted ones. Tested them on https://www.regexpal.com/. The expression is:
PHP Code:
\$\((\w+) ?: ?\((\w+)\) ?(\w+)\) 

The 'right' variations I came up with are:

$(reffield : (ModuleName) field)
$(reffield: (ModuleName) field)
$(reffield :(ModuleName) field)
$(reffield:(ModuleName) field)
$(reffield : (ModuleName)field)
$(reffield: (ModuleName)field)
$(reffield :(ModuleName)field)
$(reffield:(ModuleName)field)

The 'wrong' ones I tested are:

$reffield: (ModuleName) field
$(reffield) : ModuleName (field)
$(retfield : ModuleName field)

Maybe we could use this one day, or just for fun keep coming up with correctly formatted or incorrectly formatted ones.


RE: A regular expression to assert Workflow expressions - aleex20 - 07-28-2019

Maybe, I will be use this expression in a new project. I will tell you if this can run. Big Grin