{"action":"created","issue":{"url":"https://api.github.com/repos/epeli/underscore.string/issues/398","labels_url":"https://api.github.com/repos/epeli/underscore.string/issues/398/labels{/name}","comments_url":"https://api.github.com/repos/epeli/underscore.string/issues/398/comments","events_url":"https://api.github.com/repos/epeli/underscore.string/issues/398/events","html_url":"https://github.com/epeli/underscore.string/issues/398","id":55211761,"number":398,"title":"Add regex support for replaceAll","user":{"login":"anthonator","id":420061,"avatar_url":"https://avatars.githubusercontent.com/u/420061?v=3","gravatar_id":"","url":"https://api.github.com/users/anthonator","html_url":"https://github.com/anthonator","followers_url":"https://api.github.com/users/anthonator/followers","following_url":"https://api.github.com/users/anthonator/following{/other_user}","gists_url":"https://api.github.com/users/anthonator/gists{/gist_id}","starred_url":"https://api.github.com/users/anthonator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthonator/subscriptions","organizations_url":"https://api.github.com/users/anthonator/orgs","repos_url":"https://api.github.com/users/anthonator/repos","events_url":"https://api.github.com/users/anthonator/events{/privacy}","received_events_url":"https://api.github.com/users/anthonator/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-22T21:31:36Z","updated_at":"2015-01-22T22:49:24Z","closed_at":"2015-01-22T22:49:24Z","body":"Being able to do a ```gsub``` type replace with regex would be great.\r\n\r\n```js\r\n_.replaceAll(phoneNumber, /[^\\d]+/, ''); // (555) 555-5555 -> 5555555555\r\n```"},"comment":{"url":"https://api.github.com/repos/epeli/underscore.string/issues/comments/71115451","html_url":"https://github.com/epeli/underscore.string/issues/398#issuecomment-71115451","issue_url":"https://api.github.com/repos/epeli/underscore.string/issues/398","id":71115451,"user":{"login":"epeli","id":225712,"avatar_url":"https://avatars.githubusercontent.com/u/225712?v=3","gravatar_id":"","url":"https://api.github.com/users/epeli","html_url":"https://github.com/epeli","followers_url":"https://api.github.com/users/epeli/followers","following_url":"https://api.github.com/users/epeli/following{/other_user}","gists_url":"https://api.github.com/users/epeli/gists{/gist_id}","starred_url":"https://api.github.com/users/epeli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epeli/subscriptions","organizations_url":"https://api.github.com/users/epeli/orgs","repos_url":"https://api.github.com/users/epeli/repos","events_url":"https://api.github.com/users/epeli/events{/privacy}","received_events_url":"https://api.github.com/users/epeli/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T22:49:24Z","updated_at":"2015-01-22T22:49:24Z","body":"Javascript Regexp supports this directly. Just append `g` to your regexp and it does exactly that\r\n\r\n    (555) 555-5555\".replace(/[^\\d]+/g, \"\") === \"5555555555\""}}