Start a new topic

RegEx "Great or Equal to" for Dictionary

I need to assign letters based on gift amount using an IOM Dictionary:


  • <= to $100 - Do Not Thank
  • >= to $100 -  TY >= $100 Letter

It must be flexible to accept either 0 decimals or 2 decimals (eg $100 or 100.50)


I found this code online and was able to adapt it for Less Than $100

  • ^(?:99.99(?:\.00?)?|\d?\d(?:\.\d\d?)?)$


I am at a loss for what to do for the greater than $100 RegEx code.


Thank you.

csv
(73 Bytes)

I had this question a while ago, and ended up doing a custom function instead of a dictionary: https://omaticsoftware.freshdesk.com/support/discussions/topics/28000006159

I saw that and do not understand it.


I am a Newbie to IOM and RegEx.

I remember feeling completely overwhelmed back when I asked the "greater than/less than" question! I ended up learning how to use the API, and it's so much easier than figuring out RegEx dictionaries--but also not an easy thing to learn.


RegEx can't do something seemingly simple like determine if a number is greater than 100, but it can look at ranges. The RegEx you found that works for less than 100 is looking for anything between .01 and 99.99, You'll need to modify to look for something between 100 and some really big number so that you don't miss one. It's not simple because you have account for each place (123 is 3 places, and 12345 is 5 places), and I don't have a solution for that--but this may help https://www.regular-expressions.info/numericranges.html

Hi Coralie,

You would want something like this:


Replacement Value

Do Not Thank


Value to Match On

^(?:99.99(?:\.00?)?|\d?\d(?:\.\d\d?)?)$


Replacement Value 2

TY >= $100 Letter


Value to Match on 2

 ^(?!Do Not Thank).*$ 


Both parts of the dictionary have RegEx turned on. Let me know if that helps!

Amy

Login to post a comment