{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/regex/issues/545","repository_url":"https://api.github.com/repos/rust-lang/regex","labels_url":"https://api.github.com/repos/rust-lang/regex/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/regex/issues/545/comments","events_url":"https://api.github.com/repos/rust-lang/regex/issues/545/events","html_url":"https://github.com/rust-lang/regex/issues/545","id":391862459,"node_id":"MDU6SXNzdWUzOTE4NjI0NTk=","number":545,"title":"Confusing error with {}","user":{"login":"CAD97","id":5992217,"node_id":"MDQ6VXNlcjU5OTIyMTc=","avatar_url":"https://avatars1.githubusercontent.com/u/5992217?v=4","gravatar_id":"","url":"https://api.github.com/users/CAD97","html_url":"https://github.com/CAD97","followers_url":"https://api.github.com/users/CAD97/followers","following_url":"https://api.github.com/users/CAD97/following{/other_user}","gists_url":"https://api.github.com/users/CAD97/gists{/gist_id}","starred_url":"https://api.github.com/users/CAD97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CAD97/subscriptions","organizations_url":"https://api.github.com/users/CAD97/orgs","repos_url":"https://api.github.com/users/CAD97/repos","events_url":"https://api.github.com/users/CAD97/events{/privacy}","received_events_url":"https://api.github.com/users/CAD97/received_events","type":"User","site_admin":false},"labels":[{"id":156638552,"node_id":"MDU6TGFiZWwxNTY2Mzg1NTI=","url":"https://api.github.com/repos/rust-lang/regex/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-17T19:44:07Z","updated_at":"2019-06-11T11:45:30Z","closed_at":"2019-06-11T11:45:30Z","author_association":"NONE","body":"I wrote the regex `r\"\\\\u{[^}]*}\"` which works (as `\\\\u{[^}]*}`) on regex101 under pcre, js, python, and go flavors. When parsing with this crate, it gives:\r\n\r\n```\r\n\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nregex parse error:\r\n    \\\\u{[^}]*}\r\n        ^\r\nerror: decimal literal empty\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n```\r\n\r\n\"decimal literal empty\" was not helpful in figuring out the problem, which was that regex_syntax expects `{}` to be a repetition, and the other mentioned regex engines silently fell back to matching a literal `{` and `}` when it wasn't a repetition. The correct unproblematic regex escapes the braces: `r\"\\\\u\\{[^}]*\\}\"`.\r\n\r\nThis could be considered a bug or a suboptimal error depending on how you think this regex should be processed. I'd be perfectly happy if the error were to say something along the lines of \"expected bounded repetition\" here, rather than the current vague \"decimal literal empty\". (I would understand the error if it were `{}`, but with something other than `}` after the `{`, it's confusing.)"}}
{"actor":{"display_login":"BurntSushi"}}