Using the match(value, RegExp) function

 3 Replies
 2 Subscribed to this topic
 15 Subscribed to this forum
Sort:
Author
Messages
ralberty
Basic Member
Posts: 6
Basic Member

    Running Lawson Security 10.0.9.

    Does anybody have any experience with the match() function?  I'm trying to restrict access to a field containing a SSN.

    I tried this: match(table.TAX-ID,'^(?!000)(?!666)(?!9)d{3}[- ]?(?!00)d{2}[- ]?(?!0000)d{4}$')   but it doesn't appear to be working. My usage of the function may be incorrect but the documentation is not very helpful.  I know the regular expression works.

    ralberty
    Basic Member
    Posts: 6
    Basic Member
      I decided to use the WildCharMatch() function and it works the way I need it to.
      Dave Amen
      Veteran Member
      Posts: 75
      Veteran Member
        Hi ralberty,
        My apologies for coming late to the party, but this may be helpful for you the next time you wish to use the match function. 

        Instead of this:

            user.attributeContains('Role','POBuyerMgrRole')||
            user.attributeContains('Role','POBuyerRole')||
            user.attributeContains('Role','POClerkRole') !!
            etc.
        you can use the match function:
            match(user.getAttribute('Role'),'PO.*')

        The gotcha: although the period before the * is NOT part of the match pattern, it MUST be there in order for the match function to work!

        Credit goes to Vic Bhagwandin at Kinder Morgan in Houston, who painstakingly tried every possible configuration until he found this!

        Would you mind posting the pattern you used which worked?

        ralberty
        Basic Member
        Posts: 6
        Basic Member
          I was basically trying to limit access to SSN's for employees that are stored as tax id's in the apvenmast table. Even though most are marked 'EMP' as a vendor group that is not always the case. I really didn't care about validating the SSN I just wanted to check to see if it is formatted like an SSN so the users couldn't search or view SSN's but still have the ability to search for valid EIN's.

          I used this WildCharMatch(table.TAX_ID,'???-??-????') and it does what I needed for the moment.

          Thanks for responding!