JolinM Posted October 6, 2020 Share Posted October 6, 2020 I right now use a Condition if {query} is less than «.», but it somehow seams wrong. Isn’t there some more elegant way to do it? Best, Link to comment
deanishe Posted October 6, 2020 Share Posted October 6, 2020 4 hours ago, JolinM said: it somehow seams wrong It is wrong. Less/more than X is for numbers. What should “less than ‘.’” mean? 4 hours ago, JolinM said: Isn’t there some more elegant way to do it? Do what? Link to comment
JolinM Posted October 7, 2020 Author Share Posted October 7, 2020 I thought "." was a wildcard in GREP 🤔. I actually want to filter based on the presence of absence of a query. My keyword has «Argument optional». Link to comment
Vero Posted October 7, 2020 Share Posted October 7, 2020 @JolinM You could just do "If query is equal to [blank], take the first path, else (when there is a query) do the "else" action". Sounds like it should do what you want? Or I may have misunderstood your question, in which case, please provide more details Cheers, Vero JolinM 1 Link to comment
deanishe Posted October 7, 2020 Share Posted October 7, 2020 (edited) 17 minutes ago, JolinM said: I thought "." was a wildcard in GREP 🤔. If you mean in regular expressions, yes it is. But if you're trying to match a regular expression, you need to set it to "matches regex", not "is less than". 17 minutes ago, JolinM said: I actually want to filter based on the presence of absence of a query. My keyword has «Argument optional». Then use "is equal to" or "is not equal to" and leave the box empty. FWIW, the correct regular expression for this case would be .+ (i.e. one or more characters). If you just use . that means “one, and only one, character” Edited October 7, 2020 by deanishe JolinM 1 Link to comment
JolinM Posted October 7, 2020 Author Share Posted October 7, 2020 Oh, both solutions are brilliant, thanks a lot for the insight! Link to comment
vitor Posted October 7, 2020 Share Posted October 7, 2020 8 hours ago, JolinM said: I thought "." was a wildcard in GREP grep uses regular expressions, which are similar to but different from wildcards. As way of example, .* in the former is just * on the latter. Link to comment
deanishe Posted October 7, 2020 Share Posted October 7, 2020 28 minutes ago, vitor said: grep uses regular expressions, which are similar to but different from wildcards. And different to (much more limited than) the regular expressions Alfred supports. And the regex engine Alfred uses is a bit unusual. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now