Project

General

Profile

Download (1.11 KB) Statistics
| Branch: | Tag: | Revision:
1
# Gopher - A precursor to HTTP - RFC 1436
2
# Pattern attributes: good slow notsofast undermatch
3
# Protocol groups: document_retrieval obsolete ietf_rfc_documented
4
# Wiki: http://www.protocolinfo.org/wiki/Gopher
5
# Copyright (C) 2008 Matthew Strait, Ethan Sommer; See ../LICENSE
6
#
7
# Gopher servers usually run on TCP port 70.
8
#
9
# This pattern is lightly tested using gopher.dna.affrc.go.jp .
10

    
11
gopher
12
# This matches the server's response, but naturally only if it is a
13
# directory listing, not if it is sending a file, because then the data 
14
# is totally arbitrary.
15

    
16
# Matches the client saying "list what you have", then the server
17
# response: one of the file type characters, any printable characters, a
18
# tab, any printable characters, a tab, something that looks like a
19
# domain name, a tab, and then a number which could be the start of a
20
# port number.
21

    
22
# "0About internet Gopher\tStuff:About us\trawBits.micro.umn.edu\t70"
23
# "\r7search by keywords on protein data using wais\twaissrc:/protein_all/protein\tgopher.dna.affrc.go.jp\t70"
24

    
25
^[\x09-\x0d]*[1-9,+tgi][\x09-\x0d -~]*\x09[\x09-\x0d -~]*\x09[a-z0-9.]*\.[a-z][a-z].?.?\x09[1-9]
(40-40/146)