{"action":"closed","issue":{"url":"https://api.github.com/repos/brenns10/libstephen/issues/12","repository_url":"https://api.github.com/repos/brenns10/libstephen","labels_url":"https://api.github.com/repos/brenns10/libstephen/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/brenns10/libstephen/issues/12/comments","events_url":"https://api.github.com/repos/brenns10/libstephen/issues/12/events","html_url":"https://github.com/brenns10/libstephen/issues/12","id":98405765,"number":12,"title":"Implement minimal regex operators!","user":{"login":"brenns10","id":5682515,"avatar_url":"https://avatars.githubusercontent.com/u/5682515?v=3","gravatar_id":"","url":"https://api.github.com/users/brenns10","html_url":"https://github.com/brenns10","followers_url":"https://api.github.com/users/brenns10/followers","following_url":"https://api.github.com/users/brenns10/following{/other_user}","gists_url":"https://api.github.com/users/brenns10/gists{/gist_id}","starred_url":"https://api.github.com/users/brenns10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brenns10/subscriptions","organizations_url":"https://api.github.com/users/brenns10/orgs","repos_url":"https://api.github.com/users/brenns10/repos","events_url":"https://api.github.com/users/brenns10/events{/privacy}","received_events_url":"https://api.github.com/users/brenns10/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/brenns10/libstephen/labels/duplicate","name":"duplicate","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-31T14:47:17Z","updated_at":"2016-03-11T19:29:37Z","closed_at":"2016-03-11T19:29:37Z","body":"Python's `re` module has minimal versions of `?`, `+`, and `*`, which all match as few characters as possible rather than as many as possible.  They are `??`, `+?`, and `*?`, respectively.  They could be very useful.  I could use them for applications like this:\r\n\r\n    .*?(?\\w+).*?\r\n\r\nWithout greedy operators, the regex would be `.*(?\\w+).*`, and the `.*` would match as many characters as possible, meaning that the capture wouldn't get anything much.\r\n\r\nThis may not be too difficult.  It would mostly be a matter of picking the right series of FSM states after the simulation finishes.  Instead of tracking lists of captured indices, I could just track sequences of states.  This would still allow me to capture substrings, but it would also allow me to select series of states that minimize or maximize the use of specific transitions."}}