-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a "RegEx Formatter" extension #88
Comments
I'm trying to do the same thing. I'd like to apply a template to an item in a list depending upon the string value of a property. I can use a choose() to get one item, but if I need more than that I have to repeat the template for each additional comparision. I assumed there was a way to use a complex condition (:cond:) but apparently this only applies to numbers. [0-9.-]+ Could we at least extend :cond: to apply =, !=, & / operators to strings as well? |
@krptodr: There is no LINQ implemented into |
@ericpyle: Yes, definitely. You could do this with an tailored extension similar to the conditional formatter. If you find a general approach, I'm happy to include the new extension to the repository. |
@axunonb Thanks for the tip. This satisfies my needs for now: Usage
Or in context of list:
|
Cool. Would it be possible to supply a unit test for the |
I've been wondering if a regex value:matches(regex) formatter might be even better. It would even work with "val1|val2" and regex should have decent cross platform support |
How would you design it? RegEx groups in connection with lists? |
@axunonb I wasn't thinking about handling lists directly. I'd do it like this (untested): Syntax Where
Thoughts? |
Agree this would be quite flexible (even more than your |
I have a list of nested objects and I'd like to get to provide some sort of condition on it so it knows which list item to grab.
My list can return entirely different things depending on a foreign relationship.
The text was updated successfully, but these errors were encountered: