{"action":"created","issue":{"url":"https://api.github.com/repos/mikesamuel/regexp-make-js/issues/19","labels_url":"https://api.github.com/repos/mikesamuel/regexp-make-js/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/mikesamuel/regexp-make-js/issues/19/comments","events_url":"https://api.github.com/repos/mikesamuel/regexp-make-js/issues/19/events","html_url":"https://github.com/mikesamuel/regexp-make-js/issues/19","id":109625129,"number":19,"title":"Flags in tag","user":{"login":"zloirock","id":2213682,"avatar_url":"https://avatars.githubusercontent.com/u/2213682?v=3","gravatar_id":"","url":"https://api.github.com/users/zloirock","html_url":"https://github.com/zloirock","followers_url":"https://api.github.com/users/zloirock/followers","following_url":"https://api.github.com/users/zloirock/following{/other_user}","gists_url":"https://api.github.com/users/zloirock/gists{/gist_id}","starred_url":"https://api.github.com/users/zloirock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zloirock/subscriptions","organizations_url":"https://api.github.com/users/zloirock/orgs","repos_url":"https://api.github.com/users/zloirock/repos","events_url":"https://api.github.com/users/zloirock/events{/privacy}","received_events_url":"https://api.github.com/users/zloirock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-03T14:16:47Z","updated_at":"2015-10-08T19:37:23Z","closed_at":null,"body":"The problem of current conception in flags. Because of them, `RegExp.make` should return a function. What about simple solution:\r\n```js\r\nRegExp.make`${source}`\r\nRegExp.make('igm')`${source}`\r\n// ->\r\nRegExp.make`/${source}/`\r\nRegExp.make`/${source}/igm`\r\n```\r\n? Like literals, all tags should begin from a slash, the last slash should show the end of source, slashes in substitutions should be escaped. I think it will make usage this method more readable."},"comment":{"url":"https://api.github.com/repos/mikesamuel/regexp-make-js/issues/comments/146665176","html_url":"https://github.com/mikesamuel/regexp-make-js/issues/19#issuecomment-146665176","issue_url":"https://api.github.com/repos/mikesamuel/regexp-make-js/issues/19","id":146665176,"user":{"login":"bergus","id":1146478,"avatar_url":"https://avatars.githubusercontent.com/u/1146478?v=3","gravatar_id":"","url":"https://api.github.com/users/bergus","html_url":"https://github.com/bergus","followers_url":"https://api.github.com/users/bergus/followers","following_url":"https://api.github.com/users/bergus/following{/other_user}","gists_url":"https://api.github.com/users/bergus/gists{/gist_id}","starred_url":"https://api.github.com/users/bergus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergus/subscriptions","organizations_url":"https://api.github.com/users/bergus/orgs","repos_url":"https://api.github.com/users/bergus/repos","events_url":"https://api.github.com/users/bergus/events{/privacy}","received_events_url":"https://api.github.com/users/bergus/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T19:37:23Z","updated_at":"2015-10-08T19:37:23Z","body":"> In PHP one writes `preg_replace(\"/foo/i\", ...)` so there's certainly precedent for having two layers of delimiters and we could look at whether this is a source of confusion or not.\r\n\r\nI'd say so, yes: http://stackoverflow.com/search?q=[php]+[regex]+escape+literal+delimiter\r\n(though of course I cannot say that ``RegExp.make('igm')`…` `` is exactly intuitive, yet we'd hopefully get no confusion about delimiters at least).\r\n\r\nPHP's approach with the flexible delimiter (`\"/foo/i\"` == `\"~foo~i\"` == `\"%foo%i\"`) is at least interesting, and we should consider it as an alternative, but none that I like. Probably for the same aesthetic reasons as you do."}}