legege / searchboxsync

Update the search bar automatically from wherever you search
4 stars 2 forks source link

Wikipedia regular expression is broken #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. search "english" on wiki

What is the expected output? What do you see instead?
Search box should sync when switch to Wikipedia tab, but nothing happend.

What version of the product are you using? On what operating system?
SearchBox sync 1.2, Firefox 3.0RC2(Gecko/2008052906 Firefox/3.0
ID:2008052906), Linux(Fedora 9)&Windows Vista&Windows XP

Please provide any additional information below.
Able to fix by new regular expression as below.

-
^http[s]?://[^.]{2,3}\.wikipedia\.org/w/index\.php\?(.*&)?search=([^&]+)
-

Original issue reported on code.google.com by shen...@gmail.com on 16 Jun 2008 at 4:39

GoogleCodeExporter commented 9 years ago
1. go http://zh.wikipedia.org
2. search "english" on page search box

url after search "english"
http://zh.wikipedia.org/w/index.php?search=english&go=%E9%80%B2%E5%85%A5

Original comment by shen...@gmail.com on 16 Jun 2008 at 4:50

GoogleCodeExporter commented 9 years ago

Original comment by legege on 2 Jul 2008 at 2:55

GoogleCodeExporter commented 9 years ago
Search URLs can take one of two formats. For example:

http://en.wikipedia.org/wiki/Special:Search?search=left+search+box&go=Go
http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=research+main&
ns0=1&fulltext=Search

A more inclusive expression seems to result in successful matches for either of 
the
examples above:

^http[s]?://[^.]{2,3}\.wikipedia\.org/(.*)search=([^&]+)

Original comment by scottjgi...@gmail.com on 11 Jul 2008 at 5:23