{"action":"created","issue":{"url":"https://api.github.com/repos/PrismJS/prism/issues/186","labels_url":"https://api.github.com/repos/PrismJS/prism/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/PrismJS/prism/issues/186/comments","events_url":"https://api.github.com/repos/PrismJS/prism/issues/186/events","html_url":"https://github.com/PrismJS/prism/issues/186","id":24018241,"number":186,"title":"fix regular expressions in components","user":{"login":"arnehormann","id":1011413,"avatar_url":"https://avatars.githubusercontent.com/u/1011413?v=3","gravatar_id":"","url":"https://api.github.com/users/arnehormann","html_url":"https://github.com/arnehormann","followers_url":"https://api.github.com/users/arnehormann/followers","following_url":"https://api.github.com/users/arnehormann/following{/other_user}","gists_url":"https://api.github.com/users/arnehormann/gists{/gist_id}","starred_url":"https://api.github.com/users/arnehormann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnehormann/subscriptions","organizations_url":"https://api.github.com/users/arnehormann/orgs","repos_url":"https://api.github.com/users/arnehormann/repos","events_url":"https://api.github.com/users/arnehormann/events{/privacy}","received_events_url":"https://api.github.com/users/arnehormann/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2013-12-10T07:38:42Z","updated_at":"2015-09-16T06:29:15Z","closed_at":"2015-09-16T06:29:15Z","body":"a lot of the regular expressions in components seem to be wrong.\r\nPartially due to misunderstanding of regexps, partially concerning their content.\r\n\r\nExamples:\r\n* `[+-]{1,2}` in operators, which should be `++?|--?` so it does not match `+-` or `-+`, too.\r\n* `&lt;{1,2}` should be `(&lt;){1,2}` so the repetition does not apply to the semicolon only\r\n* nearly everything should be surrounded by word boundaries (`\\b`)\r\n* some usages of identifiers only match lower case, the include section also capital case\r\n\r\nI started rewriting them, but I gave up when I reached coffeescript because I don't know the language and can't make anything of most of the regexps - what is the intended match of `[_?a-z-|A-Z-]+`?\r\nI'll probably still submit a PR later, but it will only be a partial fix."},"comment":{"url":"https://api.github.com/repos/PrismJS/prism/issues/comments/140643278","html_url":"https://github.com/PrismJS/prism/issues/186#issuecomment-140643278","issue_url":"https://api.github.com/repos/PrismJS/prism/issues/186","id":140643278,"user":{"login":"Golmote","id":565460,"avatar_url":"https://avatars.githubusercontent.com/u/565460?v=3","gravatar_id":"","url":"https://api.github.com/users/Golmote","html_url":"https://github.com/Golmote","followers_url":"https://api.github.com/users/Golmote/followers","following_url":"https://api.github.com/users/Golmote/following{/other_user}","gists_url":"https://api.github.com/users/Golmote/gists{/gist_id}","starred_url":"https://api.github.com/users/Golmote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Golmote/subscriptions","organizations_url":"https://api.github.com/users/Golmote/orgs","repos_url":"https://api.github.com/users/Golmote/repos","events_url":"https://api.github.com/users/Golmote/events{/privacy}","received_events_url":"https://api.github.com/users/Golmote/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T06:29:15Z","updated_at":"2015-09-16T06:29:15Z","body":"Now we have tests, most of the regexps have been rewritten (or at least checked). I can't assure you there are no more issues in them but if there are, they'll have to be fixed on a case-by-case basis."}}