{"action":"created","issue":{"url":"https://api.github.com/repos/PrismJS/prism/issues/810","labels_url":"https://api.github.com/repos/PrismJS/prism/issues/810/labels{/name}","comments_url":"https://api.github.com/repos/PrismJS/prism/issues/810/comments","events_url":"https://api.github.com/repos/PrismJS/prism/issues/810/events","html_url":"https://github.com/PrismJS/prism/issues/810","id":111547986,"number":810,"title":"Fix for clike negative number styling","user":{"login":"zot","id":26665,"avatar_url":"https://avatars.githubusercontent.com/u/26665?v=3","gravatar_id":"","url":"https://api.github.com/users/zot","html_url":"https://github.com/zot","followers_url":"https://api.github.com/users/zot/followers","following_url":"https://api.github.com/users/zot/following{/other_user}","gists_url":"https://api.github.com/users/zot/gists{/gist_id}","starred_url":"https://api.github.com/users/zot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zot/subscriptions","organizations_url":"https://api.github.com/users/zot/orgs","repos_url":"https://api.github.com/users/zot/repos","events_url":"https://api.github.com/users/zot/events{/privacy}","received_events_url":"https://api.github.com/users/zot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-15T05:31:22Z","updated_at":"2015-10-15T05:43:44Z","closed_at":null,"body":"The number definition starts with \\b- but - is not a word boundary and digits are, so the - is not getting styled as part of the number for negative numbers surrounded by spaces or start/end of the string.  Try these matches and see.  This match against the current number definition returns `[\"1\"]`:\r\n``` js\r\n'-1'.match(/\\b-?(?:0x[\\da-f]+|\\d*\\.?\\d+(?:e[+-]?\\d+)?)\\b/i)\r\n```\r\nbut this match against a slightly modified definition returns `[\"-1\"]`\r\n``` js\r\n'-1'.match(/-?\\b(?:0x[\\da-f]+|\\d*\\.?\\d+(?:e[+-]?\\d+)?)\\b/i)\r\n```\r\nWhen matched against `\"x-1\"` both regular expressions return the same match, so I think you'll have the correct match if you just move the leading \\b after the -?"},"comment":{"url":"https://api.github.com/repos/PrismJS/prism/issues/comments/148287246","html_url":"https://github.com/PrismJS/prism/issues/810#issuecomment-148287246","issue_url":"https://api.github.com/repos/PrismJS/prism/issues/810","id":148287246,"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-10-15T05:43:44Z","updated_at":"2015-10-15T05:43:44Z","body":"Hi! I already noticed this, though I'm quite satisfied with the current behaviour where the `-` symbol is highlighted as operator (furthermore, AFAIK, most languages actually implement it as an unary minus operator, so it makes sense).\r\n\r\nThe solution you propose will indeed highlight `-1` as a number, but it will also highlight `4-1` as a whole number...\r\n\r\nI definitely think the best move here would be to remove all intents to include the minus operator in the number regexes.\r\n"}}