Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


fz9sgh
2013-09-23T17:58:55Z
Hi, I am trying to use the REGEX MatchGetGroup function without much success. I tried looking up information but did not find any. I am hoping to split a string based on '*' and pick the 5th node and was hoping that this function could do it.

Input String:
11111*22222*33333*44444*55555*666666

Output String:
55555

Can REGEX MatchGetGroup do this ? Also, woul dit be possible get more explanation on this function.

KI
Sponsor
Forum information
Support
2013-10-03T07:15:02Z
Unfortunately we are not expert on regex - we just provide the tools. Perhaps you can find other forum for writing the actual regex. Once confirmed that it works please contact is if the query does not work in VisualCron.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
KJDavie
2013-10-16T01:37:06Z
Hi,

... Not sure if you got this sorted but give this a try.

We use these functions with our banking files, which are complex multi-part names we want to rename to make our life easier.

Unfortunately in your example * is also used in defining the Regex so that is making your life more difficult.

If you simply escape the * that should give you the answer you are looking for:

(The * Between Groups is escaped with the \).

{REGEX(MatchGetGroup|11111*22222*33333*44444*55555*66666|(.*)\*(.*)\*(.*)\*(.*)\*(.*)\*(.*)|5)}

I would suggest if you get into this, that you use and set a variable using the regular expression as a task step, as an aid to debugging your Regex (keep running that task with the regex until you get the answer you are looking for) and then use the variable result in the downstream tasks.

If the REGEX gets too complicated (its a function after all) you may find kicking out to Powershell and using the regex there to be a more maintainable . . . . and documented way to handle this.

As an aside, if you can I would steer away from * as a delimiter if you can . . . . For REGEX and WinDoze reasons !

Good Luck !
KJDavie attached the following image(s):
Scroll to Top