{"action":"created","issue":{"url":"https://api.github.com/repos/watir/watir-webdriver/issues/331","labels_url":"https://api.github.com/repos/watir/watir-webdriver/issues/331/labels{/name}","comments_url":"https://api.github.com/repos/watir/watir-webdriver/issues/331/comments","events_url":"https://api.github.com/repos/watir/watir-webdriver/issues/331/events","html_url":"https://github.com/watir/watir-webdriver/pull/331","id":66198292,"number":331,"title":"Optimize regexp selectors when using xpath","user":{"login":"marxarelli","id":239740,"avatar_url":"https://avatars.githubusercontent.com/u/239740?v=3","gravatar_id":"","url":"https://api.github.com/users/marxarelli","html_url":"https://github.com/marxarelli","followers_url":"https://api.github.com/users/marxarelli/followers","following_url":"https://api.github.com/users/marxarelli/following{/other_user}","gists_url":"https://api.github.com/users/marxarelli/gists{/gist_id}","starred_url":"https://api.github.com/users/marxarelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marxarelli/subscriptions","organizations_url":"https://api.github.com/users/marxarelli/orgs","repos_url":"https://api.github.com/users/marxarelli/repos","events_url":"https://api.github.com/users/marxarelli/events{/privacy}","received_events_url":"https://api.github.com/users/marxarelli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-03T17:53:08Z","updated_at":"2015-04-09T16:24:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/watir/watir-webdriver/pulls/331","html_url":"https://github.com/watir/watir-webdriver/pull/331","diff_url":"https://github.com/watir/watir-webdriver/pull/331.diff","patch_url":"https://github.com/watir/watir-webdriver/pull/331.patch"},"body":"Regexp selectors are highly inefficient as they require additional round\r\ntrip requests (to retrieve attribute values) for each element that\r\nmatches the simplified selector. This optimization limits the number of\r\nrequests needed by converting leading and trailing runs of literals in\r\neach regular expression to to an xpath `contains` predicate. Note that\r\nproblematic regular expressions such as case insensitive patterns and\r\nthose containing '|' are not converted."},"comment":{"url":"https://api.github.com/repos/watir/watir-webdriver/issues/comments/91280466","html_url":"https://github.com/watir/watir-webdriver/pull/331#issuecomment-91280466","issue_url":"https://api.github.com/repos/watir/watir-webdriver/issues/331","id":91280466,"user":{"login":"marxarelli","id":239740,"avatar_url":"https://avatars.githubusercontent.com/u/239740?v=3","gravatar_id":"","url":"https://api.github.com/users/marxarelli","html_url":"https://github.com/marxarelli","followers_url":"https://api.github.com/users/marxarelli/followers","following_url":"https://api.github.com/users/marxarelli/following{/other_user}","gists_url":"https://api.github.com/users/marxarelli/gists{/gist_id}","starred_url":"https://api.github.com/users/marxarelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marxarelli/subscriptions","organizations_url":"https://api.github.com/users/marxarelli/orgs","repos_url":"https://api.github.com/users/marxarelli/repos","events_url":"https://api.github.com/users/marxarelli/events{/privacy}","received_events_url":"https://api.github.com/users/marxarelli/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T16:24:16Z","updated_at":"2015-04-09T16:24:16Z","body":"I'm a little hesitant to implement those more complex conversions simply because I think the margin of error is going to be pretty wide. This was mean purely as an optimization to avoid WebDriver round trips in cases where a really basic regexp is being used.\r\n\r\nI'll go ahead and implement your other suggestions and we can go from there."}}