{"action":"created","issue":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2661","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2661/labels{/name}","comments_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2661/comments","events_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2661/events","html_url":"https://github.com/fish-shell/fish-shell/issues/2661","id":125360177,"number":2661,"title":"Like wildcards: support sets as known from regular expressions","user":{"login":"thfi","id":2264227,"avatar_url":"https://avatars.githubusercontent.com/u/2264227?v=3","gravatar_id":"","url":"https://api.github.com/users/thfi","html_url":"https://github.com/thfi","followers_url":"https://api.github.com/users/thfi/followers","following_url":"https://api.github.com/users/thfi/following{/other_user}","gists_url":"https://api.github.com/users/thfi/gists{/gist_id}","starred_url":"https://api.github.com/users/thfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thfi/subscriptions","organizations_url":"https://api.github.com/users/thfi/orgs","repos_url":"https://api.github.com/users/thfi/repos","events_url":"https://api.github.com/users/thfi/events{/privacy}","received_events_url":"https://api.github.com/users/thfi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fish-shell/fish-shell/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/fish-shell/fish-shell/milestones/8","html_url":"https://github.com/fish-shell/fish-shell/milestones/fish-tank","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/milestones/8/labels","id":343670,"number":8,"title":"fish-tank","description":"Issues (typically enhancement requests) that are worth considering but there's no consensus on, or where the path forward is not clear.","creator":{"login":"ridiculousfish","id":920838,"avatar_url":"https://avatars.githubusercontent.com/u/920838?v=3","gravatar_id":"","url":"https://api.github.com/users/ridiculousfish","html_url":"https://github.com/ridiculousfish","followers_url":"https://api.github.com/users/ridiculousfish/followers","following_url":"https://api.github.com/users/ridiculousfish/following{/other_user}","gists_url":"https://api.github.com/users/ridiculousfish/gists{/gist_id}","starred_url":"https://api.github.com/users/ridiculousfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridiculousfish/subscriptions","organizations_url":"https://api.github.com/users/ridiculousfish/orgs","repos_url":"https://api.github.com/users/ridiculousfish/repos","events_url":"https://api.github.com/users/ridiculousfish/events{/privacy}","received_events_url":"https://api.github.com/users/ridiculousfish/received_events","type":"User","site_admin":false},"open_issues":48,"closed_issues":16,"state":"open","created_at":"2013-05-28T21:04:35Z","updated_at":"2016-01-07T17:04:18Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-01-07T09:49:10Z","updated_at":"2016-01-18T10:36:48Z","closed_at":null,"body":"In addition to the generic wildcards and just like Bash and regular expressions, Fish should support _sets_ for filenames.\r\nExample: `201[456]` should match `2014`, `2015`, and `2016`, but not `2013` or `2009`."},"comment":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/comments/172493220","html_url":"https://github.com/fish-shell/fish-shell/issues/2661#issuecomment-172493220","issue_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2661","id":172493220,"user":{"login":"faho","id":5185367,"avatar_url":"https://avatars.githubusercontent.com/u/5185367?v=3","gravatar_id":"","url":"https://api.github.com/users/faho","html_url":"https://github.com/faho","followers_url":"https://api.github.com/users/faho/followers","following_url":"https://api.github.com/users/faho/following{/other_user}","gists_url":"https://api.github.com/users/faho/gists{/gist_id}","starred_url":"https://api.github.com/users/faho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faho/subscriptions","organizations_url":"https://api.github.com/users/faho/orgs","repos_url":"https://api.github.com/users/faho/repos","events_url":"https://api.github.com/users/faho/events{/privacy}","received_events_url":"https://api.github.com/users/faho/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T10:36:48Z","updated_at":"2016-01-18T10:36:48Z","body":">As I do not require or request more complex regular expressions like [0-5]+, maybe it is sufficient to accept simple sets like [345] as a condensed alternative to {3,4,5}.\r\n\r\nThat actually sounds worse than how I interpreted it - preferably, there'd be one way to do this stuff. If there's more than one there's more to learn, more potential for confusion and more characters that are reserved and therefore need to be escaped if they are to be interpreted literally.\r\n\r\nCurrently, there's one case where \"[1]\" may be interpreted by fish in a non-literal manner, and that's if it is preceded by \"$\" and a valid variable name, in which case it is seen as a list index.\r\n\r\nThat trade-off doesn't sound good for one character per-element (and the `seq` way gets shorter the longer your list of allowable characters becomes).\r\n\r\nPlus, that's not actually how bash behaves - bash treats `[345]` as a glob, meaning it will try to match filenames. Though bash, like with \"*\" will let the uninterpreted glob through if there is no match. That means e.g. `echo foo[345]` will print any combination of `foo3`, `foo4` and `foo5` if any of those exist and `foo[345]` otherwise.\r\n\r\n> For someone who is used to Bash and regular expressions, writing [345] is both quicker and more intuitve than {3,4,5}.\r\n\r\nBash knows both, and having used bash for years, I've not used the former.\r\n\r\nIn summation: We should consider this for some other way of generating filenames (a `glob` builtin like @ridiculousfish has proposed), but the syntax itself does not seem to be a good idea IMHO.\r\n"}}