Start a new topic

Dictionary Issue- RegEx to translate dollar amount to specific letter code

So, I am trying to create a dictionary that can translate a dollar amount to a specific letter code. Anything $1-$499 gets a specific letter, anything above $500 gets another. With the help of some superstars on staff I have gotten this far:

$1 ^(.*?)\..*$ TRUE FALSE
\D TRUE FALSE
^0$ TRUE FALSE
/$ TRUE FALSE
LOW LETTER ^[1-4]\d{2}$ TRUE FALSE
LOW LETTER ^\d{1,2}$ TRUE FALSE
HIGH LETTER ^(?!(1-499)$).* TRUE FALSE

But in testing it is not working nicely. Thought I had it for a second, but no dice.

What am I missing?

1 Comment

Change the section of your last value to match on from "1-499" to "LOW LETTER" (without the quotes). RegEx dictionaries work based upon order of operations. So first you are converting anything below 499.99 to "LOW LETTER" the last section says anything that has not been assigned the value of "LOW LETTER" needs to be assigned "HIGH LETTER"

 

So the last row would be value to match on ^(?!(LOW LETTER)$).* and replacement value would be HIGH LETTER

Login or Signup to post a comment