{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/668","repository_url":"https://api.github.com/repos/hashicorp/consul-template","labels_url":"https://api.github.com/repos/hashicorp/consul-template/issues/668/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/consul-template/issues/668/comments","events_url":"https://api.github.com/repos/hashicorp/consul-template/issues/668/events","html_url":"https://github.com/hashicorp/consul-template/issues/668","id":163417578,"number":668,"title":"regexMatch requires 2 arguments","user":{"login":"jippi","id":22841,"avatar_url":"https://avatars.githubusercontent.com/u/22841?v=3","gravatar_id":"","url":"https://api.github.com/users/jippi","html_url":"https://github.com/jippi","followers_url":"https://api.github.com/users/jippi/followers","following_url":"https://api.github.com/users/jippi/following{/other_user}","gists_url":"https://api.github.com/users/jippi/gists{/gist_id}","starred_url":"https://api.github.com/users/jippi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jippi/subscriptions","organizations_url":"https://api.github.com/users/jippi/orgs","repos_url":"https://api.github.com/users/jippi/repos","events_url":"https://api.github.com/users/jippi/events{/privacy}","received_events_url":"https://api.github.com/users/jippi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-01T15:18:03Z","updated_at":"2016-07-01T15:24:41Z","closed_at":null,"body":"```\r\n{{ with node }}\r\n    {{ range $key, $pairs := tree \"apps/something/supervisor\" | byKey -}}\r\n        {{- $matchType := $pairs.process_type.Value | regexMatch \"^{{.Node.Node}}\" -}}\r\n        {{- if (or (not $pairs.process_type.Value) ($matchType)) -}}\r\n            {{- $numprocs := $pairs.numprocs.Value | parseInt -}}\r\n            {{- range $i := loop 0 $numprocs -}}\r\n// something amazing\r\n            {{ end -}}\r\n        {{ end -}}\r\n    {{- end -}}\r\n{{- end -}}\r\n```\r\n\r\nyields \r\n\r\n```\r\ntemplate: template: supervisor.ctmpl:$x:54: executing \"$file\" at <regexMatch>: wrong number of args for regexMatch: want 2 got 1\r\n```\r\n\r\nRunning CT v0.14.0\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/comments/229975540","html_url":"https://github.com/hashicorp/consul-template/issues/668#issuecomment-229975540","issue_url":"https://api.github.com/repos/hashicorp/consul-template/issues/668","id":229975540,"user":{"login":"sethvargo","id":408570,"avatar_url":"https://avatars.githubusercontent.com/u/408570?v=3","gravatar_id":"","url":"https://api.github.com/users/sethvargo","html_url":"https://github.com/sethvargo","followers_url":"https://api.github.com/users/sethvargo/followers","following_url":"https://api.github.com/users/sethvargo/following{/other_user}","gists_url":"https://api.github.com/users/sethvargo/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvargo/subscriptions","organizations_url":"https://api.github.com/users/sethvargo/orgs","repos_url":"https://api.github.com/users/sethvargo/repos","events_url":"https://api.github.com/users/sethvargo/events{/privacy}","received_events_url":"https://api.github.com/users/sethvargo/received_events","type":"User","site_admin":false},"created_at":"2016-07-01T15:24:41Z","updated_at":"2016-07-01T15:24:41Z","body":"Hi @jippi \r\n\r\nI think you need to use parenthesis or something here. This is Go's templating language, not Consul Template. It doesn't look like the pipe argument is taking place, probably because assignment is occurring first. I would write this as this instead:\r\n\r\n```liquid\r\n{{ $matchType := regexMatch \"^{{.Node.Node}}\" pairs.process_type.Value }}\r\n```"}}
{"actor":{"display_login":"sethvargo"}}