{"action":"created","issue":{"url":"https://api.github.com/repos/fzaninotto/Faker/issues/701","labels_url":"https://api.github.com/repos/fzaninotto/Faker/issues/701/labels{/name}","comments_url":"https://api.github.com/repos/fzaninotto/Faker/issues/701/comments","events_url":"https://api.github.com/repos/fzaninotto/Faker/issues/701/events","html_url":"https://github.com/fzaninotto/Faker/pull/701","id":106214022,"number":701,"title":"Support an asterisk in bothify and optimize","user":{"login":"nineinchnick","id":795177,"avatar_url":"https://avatars.githubusercontent.com/u/795177?v=3","gravatar_id":"","url":"https://api.github.com/users/nineinchnick","html_url":"https://github.com/nineinchnick","followers_url":"https://api.github.com/users/nineinchnick/followers","following_url":"https://api.github.com/users/nineinchnick/following{/other_user}","gists_url":"https://api.github.com/users/nineinchnick/gists{/gist_id}","starred_url":"https://api.github.com/users/nineinchnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nineinchnick/subscriptions","organizations_url":"https://api.github.com/users/nineinchnick/orgs","repos_url":"https://api.github.com/users/nineinchnick/repos","events_url":"https://api.github.com/users/nineinchnick/events{/privacy}","received_events_url":"https://api.github.com/users/nineinchnick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-09-13T12:28:39Z","updated_at":"2015-09-14T08:30:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fzaninotto/Faker/pulls/701","html_url":"https://github.com/fzaninotto/Faker/pull/701","diff_url":"https://github.com/fzaninotto/Faker/pull/701.diff","patch_url":"https://github.com/fzaninotto/Faker/pull/701.patch"},"body":"`Base::bothify()` now replaces an asterisk ('*') with either a random number or a random letter.\r\n\r\nI also replaced `preg_replace_callback` in `numerify` and `lexify` as it is slower than iterating over a range of chars found by using `strpos` and `strrpos`.\r\n\r\nBenchmarks are available here: https://gist.github.com/nineinchnick/84895a560910e3ead9cc\r\n\r\nThe biggest question is should we worry about UTF-8? I guess in a worst case it could replace the wrong byte. There are a few SO questions how to iterate over UTF-8 strings efficiently.\r\n\r\nShould the new helper method `Base::replaceWildcard` be public?"},"comment":{"url":"https://api.github.com/repos/fzaninotto/Faker/issues/comments/139999629","html_url":"https://github.com/fzaninotto/Faker/pull/701#issuecomment-139999629","issue_url":"https://api.github.com/repos/fzaninotto/Faker/issues/701","id":139999629,"user":{"login":"fzaninotto","id":99944,"avatar_url":"https://avatars.githubusercontent.com/u/99944?v=3","gravatar_id":"","url":"https://api.github.com/users/fzaninotto","html_url":"https://github.com/fzaninotto","followers_url":"https://api.github.com/users/fzaninotto/followers","following_url":"https://api.github.com/users/fzaninotto/following{/other_user}","gists_url":"https://api.github.com/users/fzaninotto/gists{/gist_id}","starred_url":"https://api.github.com/users/fzaninotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fzaninotto/subscriptions","organizations_url":"https://api.github.com/users/fzaninotto/orgs","repos_url":"https://api.github.com/users/fzaninotto/repos","events_url":"https://api.github.com/users/fzaninotto/events{/privacy}","received_events_url":"https://api.github.com/users/fzaninotto/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T08:30:36Z","updated_at":"2015-09-14T08:30:36Z","body":"No, just use a sample UTF-8 string with a couple special chars AND placeholders, and check that the result matches the expected with a regular expression (using `/u`)"}}