Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A regular expression to assert Workflow expressions
#1
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.
Reply


Messages In This Thread
A regular expression to assert Workflow expressions - Guido1982 - 09-21-2018, 07:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)