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
#2
Maybe, I will be use this expression in a new project. I will tell you if this can run. Big Grin
[color=#000000]I love art and technology. | Actually I've a blog of[/color] [url=https://www.tatuajesinks.com/][color=#000000]meaning of tattoos[/color][/url]. | [color=#000000]I'm studying data science.[/color]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)