exports.Text =
class Text
constructor: ( @text )->
exports.Text =
class Text
constructor: ( @text )->
regexString: ->
regExpEscape @text
test: ( string )->
@text == string
returns a string for building the url if it matches the key conditions
url: ( string )->
if @test(string) then string else false
returns a unique id that can be compared to other parts
toString: ->
"text-#{@text}"
regExpEscape = do ->
specials = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\' ]
sRE = new RegExp "(\\#{ specials.join '|\\' })", 'g'
( text )-> text.replace sRE, '\\$1'