| Products | Versions |
|---|---|
| Spotfire Analyst | All supported versions |
Regular Expression comparison function ~= can be easily used to limit data on String values.
For example: The expression "If( Arg1 ~= Arg2 , true, false)" returns true if the Arg2 regular expression string matches the Arg1 string
| ID | Fruit |
|---|---|
| 1 | Apple |
| 2 | Fruit |
| 3 | Banana |
| 4 | fruit |
| 5 | Kale |
| 6 | fru |
| 7 | Kiwi |
| 8 | fr |
| 9 | Mango |
| 10 | fruits |
| 11 | Orange |
| 12 | fru$ |
| 13 | thisfruits++ |
2)If(Lower([Fruit]) ~= "fr*",true,false)
All fruits starting with "fr"
3)If(Lower([Fruit]) ~= "a$",true,false)
All fruits ending in "a"
4)If(Lower([Fruit]) ~= "^[f-m]",false,true)
All fruits not starting with "f" or "m"
5)If(Lower([Fruit]) ~= "k[a-z]*[e-i]$",true,false)
All fruits starting with "k" and ending with "e" or "i"
6)If(Lower([Fruit]) ~= "l+",true,false)
one or more occurences of "l" in fruit names
7)If(Lower([Fruit]) ~= "[no]",true,false)
one of the characters in the bracket
8)If(Lower([Fruit]) ~= "[1-9]+",true,false)
All fruits containing one or more occurences of digits
Note: Meaning of quantifiers in regular expressions
$ - Ending with this character
? - one or none
+ - one or more
* - zero or more
An example Spotfire analysis file is attached for reference.