mimic ABL CAN-DO() in javascript

Posted by Akioma on 08-Oct-2015 06:50

Hi all,

I need to do a similar check in javascript as the CAN-DO(list, value) function in ABL (also supporting wildcards and !).

I would expect that this can be done through a regular expression. Unfortunately I don't belong to the group of ~10 people on this planet that really understand regex patterns...

So I was hoping someone here can give me some tips, or ideally provide the neccesary regex string... :-)


All Replies

Posted by James Palmer on 08-Oct-2015 07:39

I don't do regex either, but I have to ask, what are you using CAN-DO for in ABL?

Posted by Peter Judge on 08-Oct-2015 08:07

Any regex post is required to quote "now you have two problems", via blog.codinghorror.com/.../ . I linked to that because he has some good advice on regex, including some tools.
I've previously used this Eclipse plugin too (http://www.myregexp.com/eclipsePlugin.html) when trying to figure this out, but it took a fair bit of testing to get the regex I wanted.
Also found http://www.johndcook.com/blog/regextip/  and the related links helpful, especially the twitter account - https://twitter.com/regextip  - he's set up. You can consume it in small doses that way.

Posted by Rom Elwell on 08-Oct-2015 08:27

There is a free tool that assists the user with building RegEx strings.  It can take a little effort to learn the workflow (at least it took me a bit) but you might this tool helpful:


This thread is closed