{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/27456","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/27456/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/27456/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/27456/events","html_url":"https://github.com/dotnet/corefx/issues/27456","id":300067547,"number":27456,"title":"API Proposal: Add Regex option to enumeration APIs","user":{"login":"JeremyKuhne","id":8184940,"avatar_url":"https://avatars3.githubusercontent.com/u/8184940?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyKuhne","html_url":"https://github.com/JeremyKuhne","followers_url":"https://api.github.com/users/JeremyKuhne/followers","following_url":"https://api.github.com/users/JeremyKuhne/following{/other_user}","gists_url":"https://api.github.com/users/JeremyKuhne/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyKuhne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyKuhne/subscriptions","organizations_url":"https://api.github.com/users/JeremyKuhne/orgs","repos_url":"https://api.github.com/users/JeremyKuhne/repos","events_url":"https://api.github.com/users/JeremyKuhne/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyKuhne/received_events","type":"User","site_admin":false},"labels":[{"id":165998434,"url":"https://api.github.com/repos/dotnet/corefx/labels/api-ready-for-review","name":"api-ready-for-review","color":"5319e7","default":false},{"id":154422420,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.IO","name":"area-System.IO","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"JeremyKuhne","id":8184940,"avatar_url":"https://avatars3.githubusercontent.com/u/8184940?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyKuhne","html_url":"https://github.com/JeremyKuhne","followers_url":"https://api.github.com/users/JeremyKuhne/followers","following_url":"https://api.github.com/users/JeremyKuhne/following{/other_user}","gists_url":"https://api.github.com/users/JeremyKuhne/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyKuhne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyKuhne/subscriptions","organizations_url":"https://api.github.com/users/JeremyKuhne/orgs","repos_url":"https://api.github.com/users/JeremyKuhne/repos","events_url":"https://api.github.com/users/JeremyKuhne/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyKuhne/received_events","type":"User","site_admin":false},"assignees":[{"login":"JeremyKuhne","id":8184940,"avatar_url":"https://avatars3.githubusercontent.com/u/8184940?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyKuhne","html_url":"https://github.com/JeremyKuhne","followers_url":"https://api.github.com/users/JeremyKuhne/followers","following_url":"https://api.github.com/users/JeremyKuhne/following{/other_user}","gists_url":"https://api.github.com/users/JeremyKuhne/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyKuhne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyKuhne/subscriptions","organizations_url":"https://api.github.com/users/JeremyKuhne/orgs","repos_url":"https://api.github.com/users/JeremyKuhne/repos","events_url":"https://api.github.com/users/JeremyKuhne/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyKuhne/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/12","html_url":"https://github.com/dotnet/corefx/milestone/12","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/12/labels","id":2323293,"number":12,"title":"2.1.0","description":".NET Core 2.1, next major release. See [official release dates](https://github.com/dotnet/core/blob/master/roadmap.md) for details.","creator":{"login":"karelz","id":5776068,"avatar_url":"https://avatars2.githubusercontent.com/u/5776068?v=4","gravatar_id":"","url":"https://api.github.com/users/karelz","html_url":"https://github.com/karelz","followers_url":"https://api.github.com/users/karelz/followers","following_url":"https://api.github.com/users/karelz/following{/other_user}","gists_url":"https://api.github.com/users/karelz/gists{/gist_id}","starred_url":"https://api.github.com/users/karelz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karelz/subscriptions","organizations_url":"https://api.github.com/users/karelz/orgs","repos_url":"https://api.github.com/users/karelz/repos","events_url":"https://api.github.com/users/karelz/events{/privacy}","received_events_url":"https://api.github.com/users/karelz/received_events","type":"User","site_admin":false},"open_issues":249,"closed_issues":5092,"state":"open","created_at":"2017-02-15T02:14:11Z","updated_at":"2018-02-26T00:37:28Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2018-02-25T22:23:48Z","updated_at":"2018-02-26T00:50:50Z","closed_at":null,"author_association":"MEMBER","body":"## Proposal\r\n\r\nNow that we have the ability to specify the match type, we should expose `Regex` as an option:\r\n\r\n``` C#\r\nnamespace System.IO\r\n{\r\n    public enum MatchType\r\n    {\r\n        Simple,\r\n        Win32,\r\n\r\n        /// <summary>\r\n        /// Expression is treated as a regular expression.\r\n        /// </summary>\r\n        /// <remarks>\r\n        /// Single line, culture invariant, explicit capture matching is used.\r\n        /// </remarks>\r\n        Regex\r\n    }\r\n}\r\n\r\nnamespace System.IO.Enumeration\r\n{\r\n    public static class FileSystemName\r\n    {\r\n        public static string TranslateWin32Expression(string expression);\r\n        public static bool MatchesWin32Expression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true);\r\n        public static bool MatchesSimpleExpression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true);\r\n\r\n        /// <summary>\r\n        /// Return true if the given regular expression matches the given name.\r\n        /// </summary>\r\n        /// <remarks>\r\n        /// Uses single line, invariant, explicit capture mode.\r\n        /// </remarks>\r\n        public static bool MatchesRegularExpression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true);\r\n    }\r\n}\r\n```\r\n## Motivation\r\n\r\nPartners are interested in having this exposed (MSBuild, PowerShell). Even though we don't have a span version of `Regex.IsMatch()`, exposing the API now will allow easier lighting up of higher performance, lower allocation implementations in the future. (As opposed to customers using `IsMatch` directly and needing to update their clients if we provide a span version in the future.)\r\n\r\n## Details\r\n\r\n- We'll pick sensible RegexOptions as a default (as described in the signature comments)\r\n- Users can override either by using Regex directly or using `?(imnsx)` options in their expressions"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/368361831","html_url":"https://github.com/dotnet/corefx/issues/27456#issuecomment-368361831","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/27456","id":368361831,"user":{"login":"JeremyKuhne","id":8184940,"avatar_url":"https://avatars3.githubusercontent.com/u/8184940?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyKuhne","html_url":"https://github.com/JeremyKuhne","followers_url":"https://api.github.com/users/JeremyKuhne/followers","following_url":"https://api.github.com/users/JeremyKuhne/following{/other_user}","gists_url":"https://api.github.com/users/JeremyKuhne/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyKuhne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyKuhne/subscriptions","organizations_url":"https://api.github.com/users/JeremyKuhne/orgs","repos_url":"https://api.github.com/users/JeremyKuhne/repos","events_url":"https://api.github.com/users/JeremyKuhne/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyKuhne/received_events","type":"User","site_admin":false},"created_at":"2018-02-26T00:50:50Z","updated_at":"2018-02-26T00:50:50Z","author_association":"MEMBER","body":"> Is there a means to cancel enumeration?\r\n\r\nThere isn't, which is part of why I'm thinking seconds at most. @ViktorHofer, what would you expect would be a generous value given the constraints of a 260 character max input?"}}
{"actor":{"display_login":"JeremyKuhne"}}