I’m sure I’m missing something simple, but how can my filter either—based on a regex condition—apply a transformation to a value or leave it intact?
In a much simplified example, I supply a single character, and if it’s a
-z
, I upper-case it, otherwise I leave it alone. I feel like this should be trivial, so I think I’m having one of my periodic syntax brain farts, but I am stuck.
[[a]my.operator[]] ==> "A"
[[7]my.operator[]] ==> "7"
While this doesn’t absolutely have to be in a single filter, it would definitely be preferable. I want to put it in a function so I can use it as a filter operator. I suppose that with the function Operator
, I can probably call out to a separate procedure or some such, but a single filter would be helpful.
Am I right? Is there a simple way to do this that I’m overlooking?