{"action":"created","issue":{"url":"https://api.github.com/repos/docker/swarm/issues/233","labels_url":"https://api.github.com/repos/docker/swarm/issues/233/labels{/name}","comments_url":"https://api.github.com/repos/docker/swarm/issues/233/comments","events_url":"https://api.github.com/repos/docker/swarm/issues/233/events","html_url":"https://github.com/docker/swarm/pull/233","id":53984311,"number":233,"title":"Proposal: Not and RegExp in Constraint Expression","user":{"login":"chanwit","id":10666,"avatar_url":"https://avatars.githubusercontent.com/u/10666?v=3","gravatar_id":"","url":"https://api.github.com/users/chanwit","html_url":"https://github.com/chanwit","followers_url":"https://api.github.com/users/chanwit/followers","following_url":"https://api.github.com/users/chanwit/following{/other_user}","gists_url":"https://api.github.com/users/chanwit/gists{/gist_id}","starred_url":"https://api.github.com/users/chanwit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chanwit/subscriptions","organizations_url":"https://api.github.com/users/chanwit/orgs","repos_url":"https://api.github.com/users/chanwit/repos","events_url":"https://api.github.com/users/chanwit/events{/privacy}","received_events_url":"https://api.github.com/users/chanwit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"aluzzardi","id":179503,"avatar_url":"https://avatars.githubusercontent.com/u/179503?v=3","gravatar_id":"","url":"https://api.github.com/users/aluzzardi","html_url":"https://github.com/aluzzardi","followers_url":"https://api.github.com/users/aluzzardi/followers","following_url":"https://api.github.com/users/aluzzardi/following{/other_user}","gists_url":"https://api.github.com/users/aluzzardi/gists{/gist_id}","starred_url":"https://api.github.com/users/aluzzardi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aluzzardi/subscriptions","organizations_url":"https://api.github.com/users/aluzzardi/orgs","repos_url":"https://api.github.com/users/aluzzardi/repos","events_url":"https://api.github.com/users/aluzzardi/events{/privacy}","received_events_url":"https://api.github.com/users/aluzzardi/received_events","type":"User","site_admin":false},"milestone":null,"comments":17,"created_at":"2015-01-11T07:04:03Z","updated_at":"2015-01-13T19:32:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/swarm/pulls/233","html_url":"https://github.com/docker/swarm/pull/233","diff_url":"https://github.com/docker/swarm/pull/233.diff","patch_url":"https://github.com/docker/swarm/pull/233.patch"},"body":"This PR proposes the use of `!` for negate and `/regexp/` for direct regexp matching to improve the constraint filters.\r\n\r\nFor example,\r\n\r\n`constraint:name=!node1` will match all nodes, expect `node1`.\r\n\r\n`constraint:name=!n*` will match all, except nodes whose name starting with `n`.\r\n\r\n`constraint:region=!us*` will match all, except nodes in `us` regions like `us-west` or `us-east`.\r\n\r\n`constraint:name=/node\\d/` will match all nodes named by `node` plus 1 digit.\r\n\r\n`constraint:name=/node[12]/` will match nodes named by `node1` and `node2`.\r\n\r\n`constraint:node=!/node-[01]-id/` will match all, except nodes id `node-0-id` and `node-1-id`.\r\n\r\n`constraint:name=!/foo\\[bar\\]/` will match all nodes, except those with name `foo[bar]`. You can see the use of escape characters here.\r\n"},"comment":{"url":"https://api.github.com/repos/docker/swarm/issues/comments/69804279","html_url":"https://github.com/docker/swarm/pull/233#issuecomment-69804279","issue_url":"https://api.github.com/repos/docker/swarm/issues/233","id":69804279,"user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T19:32:19Z","updated_at":"2015-01-13T19:32:19Z","body":"@vieux no *big* concerns, apart from possibly allowing a bit more flexibility (https://github.com/docker/swarm/pull/233#issuecomment-69705637); using `~` wouldn't restrict the regex to use a hard-coded `/` for quoting, which could make it easier to write regexes *containing* slashes.\r\n\r\nAlso, the option to have case-insensitive matching as illustrated in the [PostgreSQL docs](http://www.postgresql.org/docs/current/static/functions-matching.html#FUNCTIONS-POSIX-TABLE) could be a nice addition.\r\n\r\nSo, to summarise; I have no *big* objections with the PR as it is, I wanted to add some alternative options to consider, before it being \"set in stone\"."}}