Browse Source

pattern: export Raw for retrieving original input

This is in addition to the String method, which is oriented more towards
human debugging.
Carl Jackson 10 years ago
parent
commit
be915f805d
2 changed files with 8 additions and 0 deletions
  1. +4
    -0
      web/regexp_pattern.go
  2. +4
    -0
      web/string_pattern.go

+ 4
- 0
web/regexp_pattern.go View File

@ -48,6 +48,10 @@ func (p regexpPattern) String() string {
return fmt.Sprintf("regexpPattern(%v)", p.re)
}
func (p regexpPattern) Raw() *regexp.Regexp {
return p.re
}
/*
I'm sorry, dear reader. I really am.


+ 4
- 0
web/string_pattern.go View File

@ -90,6 +90,10 @@ func (s stringPattern) String() string {
return fmt.Sprintf("stringPattern(%q)", s.raw)
}
func (s stringPattern) Raw() string {
return s.raw
}
// "Break characters" are characters that can end patterns. They are not allowed
// to appear in pattern names. "/" was chosen because it is the standard path
// separator, and "." was chosen because it often delimits file extensions. ";"


Loading…
Cancel
Save