{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5098","repository_url":"https://api.github.com/repos/HaxeFoundation/haxe","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5098/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5098/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5098/events","html_url":"https://github.com/HaxeFoundation/haxe/pull/5098","id":147531576,"number":5098,"title":"add EReg.escape","user":{"login":"nadako","id":49749,"avatar_url":"https://avatars.githubusercontent.com/u/49749?v=3","gravatar_id":"","url":"https://api.github.com/users/nadako","html_url":"https://github.com/nadako","followers_url":"https://api.github.com/users/nadako/followers","following_url":"https://api.github.com/users/nadako/following{/other_user}","gists_url":"https://api.github.com/users/nadako/gists{/gist_id}","starred_url":"https://api.github.com/users/nadako/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadako/subscriptions","organizations_url":"https://api.github.com/users/nadako/orgs","repos_url":"https://api.github.com/users/nadako/repos","events_url":"https://api.github.com/users/nadako/events{/privacy}","received_events_url":"https://api.github.com/users/nadako/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HaxeFoundation/haxe/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/9","html_url":"https://github.com/HaxeFoundation/haxe/milestones/3.4","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/9/labels","id":1152081,"number":9,"title":"3.4","description":"","creator":{"login":"Simn","id":634365,"avatar_url":"https://avatars.githubusercontent.com/u/634365?v=3","gravatar_id":"","url":"https://api.github.com/users/Simn","html_url":"https://github.com/Simn","followers_url":"https://api.github.com/users/Simn/followers","following_url":"https://api.github.com/users/Simn/following{/other_user}","gists_url":"https://api.github.com/users/Simn/gists{/gist_id}","starred_url":"https://api.github.com/users/Simn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Simn/subscriptions","organizations_url":"https://api.github.com/users/Simn/orgs","repos_url":"https://api.github.com/users/Simn/repos","events_url":"https://api.github.com/users/Simn/events{/privacy}","received_events_url":"https://api.github.com/users/Simn/received_events","type":"User","site_admin":false},"open_issues":286,"closed_issues":16,"state":"open","created_at":"2015-06-05T20:50:14Z","updated_at":"2016-04-12T15:30:33Z","due_on":"2016-11-05T23:00:00Z","closed_at":null},"comments":4,"created_at":"2016-04-11T19:38:45Z","updated_at":"2016-04-12T16:01:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/5098","html_url":"https://github.com/HaxeFoundation/haxe/pull/5098","diff_url":"https://github.com/HaxeFoundation/haxe/pull/5098.diff","patch_url":"https://github.com/HaxeFoundation/haxe/pull/5098.patch"},"body":"I need this from time to time and I think it should be in the std lib. I tried to use platform-native (or recommended) regex escaping functions, but for others (cpp,neko,hl,lua) I used the implementation involving `map`. It works but it may not be the most efficient solution which can be improved in future.\r\n\r\nI know we're in feature freeze, but this addition seems to be very minor and safe for 3.3."},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments/208981268","html_url":"https://github.com/HaxeFoundation/haxe/pull/5098#issuecomment-208981268","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5098","id":208981268,"user":{"login":"fponticelli","id":163915,"avatar_url":"https://avatars.githubusercontent.com/u/163915?v=3","gravatar_id":"","url":"https://api.github.com/users/fponticelli","html_url":"https://github.com/fponticelli","followers_url":"https://api.github.com/users/fponticelli/followers","following_url":"https://api.github.com/users/fponticelli/following{/other_user}","gists_url":"https://api.github.com/users/fponticelli/gists{/gist_id}","starred_url":"https://api.github.com/users/fponticelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fponticelli/subscriptions","organizations_url":"https://api.github.com/users/fponticelli/orgs","repos_url":"https://api.github.com/users/fponticelli/repos","events_url":"https://api.github.com/users/fponticelli/events{/privacy}","received_events_url":"https://api.github.com/users/fponticelli/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T16:01:13Z","updated_at":"2016-04-12T16:01:13Z","body":"There is a lot of value in that function to build runtime patterns. I\ntotally support its presence in std, in fact I have it already in thx.core.\nYou might refer it to double check the escaping logic:\nhttps://github.com/fponticelli/thx.core/blob/master/src/thx/ERegs.hx\n\nOn Tue, Apr 12, 2016 at 5:26 AM, Dan Korostelev <notifications@github.com>\nwrote:\n\n> One use-case I had lately is with hxmustache. It uses regexp-based parsing\n> and one can specify custom tags (e.g. (: instead of {{), so we need to\n> escape given string to use it in a regex.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/HaxeFoundation/haxe/pull/5098#issuecomment-208855900>\n>\n"}}