Permalink
Browse files

tweaked decimal regexps

  • Loading branch information...
1 parent a2553ee commit bef007770c502e9e7bdd1a45f0c822584f526ece evan wheeler committed Jan 19, 2009
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/fuzz/token/height.rb
  2. +1 −1 lib/fuzz/token/length.rb
  3. +1 −1 lib/fuzz/token/weight.rb
@@ -5,7 +5,7 @@ module Fuzz::Token
class Height < Base
# this should be merged with the Length
# token, by wrapping and patching the pattern
- Pattern = '(?:(?:height of|height:?|standing)\s*)?(\d+)(\.\d+)?(?:\s*(?:centimeters?|cm))?(?:\s*(?:tall))?'
+ Pattern = '(?:(?:height of|height:?|standing)\s*)?(\d+)(\.\d*)?(?:\s*(?:centimeters?|cm))?(?:\s*(?:tall))?'
# convert captured digits
# into a float object
@@ -3,7 +3,7 @@
module Fuzz::Token
class Length < Base
- Pattern = '(\d+)(\.\d+)?(?:\s*(?:centimeters?|cm))?'
+ Pattern = '(\d+)(\.\d*)?(?:\s*(?:centimeters?|cm))?'
# convert captured digits
# into a float object
@@ -5,7 +5,7 @@ module Fuzz::Token
class Weight < Base
Prefix = '(?:weighing?\s*)?'
- Meat = '(\d+)(\.\d+)?'
+ Meat = '(\d+)(\.\d*)?'
Suffix = '(?:\s*(?:kilogram?|kilogrammes?|kg))?'
# create one big ugly regex

0 comments on commit bef0077

Please sign in to comment.