{"action":"created","issue":{"url":"https://api.github.com/repos/discourse/discourse/issues/3411","labels_url":"https://api.github.com/repos/discourse/discourse/issues/3411/labels{/name}","comments_url":"https://api.github.com/repos/discourse/discourse/issues/3411/comments","events_url":"https://api.github.com/repos/discourse/discourse/issues/3411/events","html_url":"https://github.com/discourse/discourse/pull/3411","id":71836824,"number":3411,"title":"Escape term for category autocomplete regex","user":{"login":"Elberet","id":361662,"avatar_url":"https://avatars.githubusercontent.com/u/361662?v=3","gravatar_id":"","url":"https://api.github.com/users/Elberet","html_url":"https://github.com/Elberet","followers_url":"https://api.github.com/users/Elberet/followers","following_url":"https://api.github.com/users/Elberet/following{/other_user}","gists_url":"https://api.github.com/users/Elberet/gists{/gist_id}","starred_url":"https://api.github.com/users/Elberet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elberet/subscriptions","organizations_url":"https://api.github.com/users/Elberet/orgs","repos_url":"https://api.github.com/users/Elberet/repos","events_url":"https://api.github.com/users/Elberet/events{/privacy}","received_events_url":"https://api.github.com/users/Elberet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-29T10:21:39Z","updated_at":"2015-04-30T23:02:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/discourse/discourse/pulls/3411","html_url":"https://github.com/discourse/discourse/pull/3411","diff_url":"https://github.com/discourse/discourse/pull/3411.diff","patch_url":"https://github.com/discourse/discourse/pull/3411.patch"},"body":"See https://meta.discourse.org/t/error-when-text-entered-in-category-select-box-contains-invalid-regex-syntax/27999?u=elberet"},"comment":{"url":"https://api.github.com/repos/discourse/discourse/issues/comments/97995045","html_url":"https://github.com/discourse/discourse/pull/3411#issuecomment-97995045","issue_url":"https://api.github.com/repos/discourse/discourse/issues/3411","id":97995045,"user":{"login":"DeanMarkTaylor","id":52425,"avatar_url":"https://avatars.githubusercontent.com/u/52425?v=3","gravatar_id":"","url":"https://api.github.com/users/DeanMarkTaylor","html_url":"https://github.com/DeanMarkTaylor","followers_url":"https://api.github.com/users/DeanMarkTaylor/followers","following_url":"https://api.github.com/users/DeanMarkTaylor/following{/other_user}","gists_url":"https://api.github.com/users/DeanMarkTaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/DeanMarkTaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeanMarkTaylor/subscriptions","organizations_url":"https://api.github.com/users/DeanMarkTaylor/orgs","repos_url":"https://api.github.com/users/DeanMarkTaylor/repos","events_url":"https://api.github.com/users/DeanMarkTaylor/events{/privacy}","received_events_url":"https://api.github.com/users/DeanMarkTaylor/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T23:02:41Z","updated_at":"2015-04-30T23:02:41Z","body":"I would recommend using a less escape crazy version:\r\n```JavaScript\r\nfunction escapeRegExp(string){\r\n  return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\r\n}\r\n```\r\nTaken from: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions"}}