{"action":"created","issue":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/1110","repository_url":"https://api.github.com/repos/openframeworks/openFrameworks","labels_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/1110/labels{/name}","comments_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/1110/comments","events_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/1110/events","html_url":"https://github.com/openframeworks/openFrameworks/issues/1110","id":3799872,"number":1110,"title":"add a simple regex function like ofSplitString()","user":{"login":"ofZach","id":142897,"avatar_url":"https://avatars.githubusercontent.com/u/142897?v=3","gravatar_id":"","url":"https://api.github.com/users/ofZach","html_url":"https://github.com/ofZach","followers_url":"https://api.github.com/users/ofZach/followers","following_url":"https://api.github.com/users/ofZach/following{/other_user}","gists_url":"https://api.github.com/users/ofZach/gists{/gist_id}","starred_url":"https://api.github.com/users/ofZach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofZach/subscriptions","organizations_url":"https://api.github.com/users/ofZach/orgs","repos_url":"https://api.github.com/users/ofZach/repos","events_url":"https://api.github.com/users/ofZach/events{/privacy}","received_events_url":"https://api.github.com/users/ofZach/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openframeworks/openFrameworks/labels/core","name":"core","color":"db6a1f"},{"url":"https://api.github.com/repos/openframeworks/openFrameworks/labels/feature","name":"feature","color":"622425"},{"url":"https://api.github.com/repos/openframeworks/openFrameworks/labels/prelim-analysis","name":"prelim-analysis","color":"31e03a"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/milestones/21","html_url":"https://github.com/openframeworks/openFrameworks/milestones/0.10.1","labels_url":"https://api.github.com/repos/openframeworks/openFrameworks/milestones/21/labels","id":902324,"number":21,"title":"0.10.1","description":"","creator":{"login":"kylemcdonald","id":157106,"avatar_url":"https://avatars.githubusercontent.com/u/157106?v=3","gravatar_id":"","url":"https://api.github.com/users/kylemcdonald","html_url":"https://github.com/kylemcdonald","followers_url":"https://api.github.com/users/kylemcdonald/followers","following_url":"https://api.github.com/users/kylemcdonald/following{/other_user}","gists_url":"https://api.github.com/users/kylemcdonald/gists{/gist_id}","starred_url":"https://api.github.com/users/kylemcdonald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylemcdonald/subscriptions","organizations_url":"https://api.github.com/users/kylemcdonald/orgs","repos_url":"https://api.github.com/users/kylemcdonald/repos","events_url":"https://api.github.com/users/kylemcdonald/events{/privacy}","received_events_url":"https://api.github.com/users/kylemcdonald/received_events","type":"User","site_admin":false},"open_issues":34,"closed_issues":1,"state":"open","created_at":"2014-12-12T22:37:18Z","updated_at":"2016-02-03T12:05:16Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2012-03-25T18:56:37Z","updated_at":"2016-03-13T19:36:23Z","closed_at":null,"body":"Todd's example has this code a few times in it by hand, but I'm thinking it's so simple it could be added along side ofSplitString() and would be really useful ?    for sure, more string utility functions are helpful, and for basic text parsing, this is great.  Poco gives us this for free, so it doesn't seem like a huge stretch to think of something like this, plus find and replace, etc.    Would make the regex example much shorter. \r\n\r\np5 has something similar, if that's a helpful argument: \r\n\r\nhttp://processing.org/reference/matchAll_.html\r\n\r\n\r\n\tvector < string > ofxRegex::getMatchedStrings (string contents, string regex );\r\n\tvector < string > ofxRegex::getMatchedStrings (string contents, string regex ){\r\n    \r\n\t    vector < string > results;\r\n\t    RegularExpression regEx(regex);\r\n\t    RegularExpression::Match match;\r\n    \r\n\t    while(regEx.match(contents, match) != 0) {\r\n        \r\n\t        // we get the sub string from the content\r\n\t        // and then trim the content so that we\r\n\t        // can continue to search \r\n\t        string foundStr = contents.substr(match.offset, match.length);\r\n\t        contents = contents.substr(match.offset + match.length);\r\n        \r\n\t        results.push_back(foundStr);\r\n        \r\n\t    }\r\n\t    return results;\r\n\t}"},"comment":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/comments/196029637","html_url":"https://github.com/openframeworks/openFrameworks/issues/1110#issuecomment-196029637","issue_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/1110","id":196029637,"user":{"login":"frauzufall","id":708121,"avatar_url":"https://avatars.githubusercontent.com/u/708121?v=3","gravatar_id":"","url":"https://api.github.com/users/frauzufall","html_url":"https://github.com/frauzufall","followers_url":"https://api.github.com/users/frauzufall/followers","following_url":"https://api.github.com/users/frauzufall/following{/other_user}","gists_url":"https://api.github.com/users/frauzufall/gists{/gist_id}","starred_url":"https://api.github.com/users/frauzufall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frauzufall/subscriptions","organizations_url":"https://api.github.com/users/frauzufall/orgs","repos_url":"https://api.github.com/users/frauzufall/repos","events_url":"https://api.github.com/users/frauzufall/events{/privacy}","received_events_url":"https://api.github.com/users/frauzufall/received_events","type":"User","site_admin":false},"created_at":"2016-03-13T19:36:23Z","updated_at":"2016-03-13T19:36:23Z","body":"Since this still seems to be open, this is the same function using std::regex, would be great to have in OF:\r\n\r\n```c++\r\nvector<string> getMatchedStrings (string contents, string regex ){\r\n\r\n\tvector <string> results;\r\n\tstd::regex regEx(regex);\r\n\r\n\tstd::regex_iterator<std::string::iterator> rit (contents.begin(), contents.end(), regEx);\r\n\tstd::regex_iterator<std::string::iterator> rend;\r\n\r\n\twhile (rit!=rend) {\r\n\t\tresults.push_back(rit->str());\r\n\t\t++rit;\r\n\t}\r\n\r\n\treturn results;\r\n}\r\n```\r\n"}}