ruby / ruby/uri

Pattern matches does not work for google search results

Open
#74 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
125
Forks
65
Avg merge
6h 4m
Merged PRs (30d)
2

Description

Google search result URL raises Invalid URI error. It appears the Regex expression here does not recognize this as a valid URL, however, you are able to navigate to it via a browser.

URL: https://www.google.com/search?q=capt.%20jacks%20family%20buffet&rlz=1C2CHBF_enUS902US902&sxsrf=APwXEdehG3ObQHEcqZT0clDT-XUDJ2iaXg:1681756568453&source=hp&ei=jpE9ZIioNOvGkPIPzP2ayAE&iflsig=AOEireoAAAAAZD2fnm-EI4rFn06RvhHNRndJIcwCmIRY&oq=capt.+jack&gs_lcp=Cgdnd3Mtd2l6EAEYADIFCAAQgAQyCgguEIAEENQCEAoyBwgAEIAEEAoyCwguEIAEEMcBEK8BMgUIABCABDIFCAAQgAQyBQgAEIAEMgcIABCABBAKMgoILhCABBDUAhAKMggIABCKBRCGAzoHCCMQ6gIQJzoECCMQJzoICAAQigUQkQI6CAgAEIAEELEDOhEILhCABBCxAxCDARDHARDRAzoOCC4QgAQQsQMQxwEQ0QM6DgguEIoFEMcBENEDEJECOg4ILhCABBDJAxDHARCvAToFCC4QgAQ6DgguEIoFEMcBEK8BEJECOgsIABCKBRCxAxCRAjoOCC4QgAQQsQMQgwEQ1AI6CwguEK8BEMcBEIAEOg0ILhCABBDHARCvARAKOgcILhCABBAKOggILhCABBDUAlC3DliGK2DeN2gBcAB4AIABnwGIAaIJkgEDMi44mAEAoAEBsAEK&sclient=gws-wiz&tbs=lf:1,lf_ui:4&tbm=lcl&rflfq=1&num=10&rldimm=425615111808136386&lqi=ChljYXB0LiBqYWNrcyBmYW1pbHkgYnVmZmV0IgOIAQFI2Oj5sryugIAIWioQABABEAIQAxgAGAEYAhgDIhhjYXB0IGphY2tzIGZhbWlseSBidWZmZXSSARFidWZmZXRfcmVzdGF1cmFudJoBI0NoWkRTVWhOTUc5blMwVkpRMEZuU1VOUGNUUTJXa0pSRUFFqgEjEAEyHxABIhtkYOxvAEEUmUj2WhSyHC6JH-F_P7crMXEaKS_gAQA&ved=2ahUKEwjS1_G2x7H-AhUxtTEKHclvB_cQvS56BAgWEAE&sa=X&rlst=f#rlfi=hd:;si:425615111808136386,l,ChljYXB0LiBqYWNrcyBmYW1pbHkgYnVmZmV0IgOIAQFI2Oj5sryugIAIWioQABABEAIQAxgAGAEYAhgDIhhjYXB0IGphY2tzIGZhbWlseSBidWZmZXSSARFidWZmZXRfcmVzdGF1cmFudJoBI0NoWkRTVWhOTUc5blMwVkpRMEZuU1VOUGNUUTJXa0pSRUFFqgEjEAEyHxABIhtkYOxvAEEUmUj2WhSyHC6JH-F_P7crMXEaKS_gAQA;mv:[[30.1955067,-85.7794086],[30.161907099999993,-85.8386264]];tbs:lrf:!1m4!1u3!2m2!3m1!1e1!2m1!1e3!3sIAE,lf:1,lf_ui:4

URI.parse(url) raises the following error: lib/uri/rfc3986_parser.rb:66:in split'`. I believe this is caused by the Regex expression not matching this URL.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported URI.parse(url) failure and inspect the regex and split logic in lib/uri/rfc3986_parser.rb around line 66. Compare the Google URL with the parser's matching rules. Done means the supplied URL is accepted without Invalid URI while existing URI parsing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.