patterns.go 638 B

1234567891011121314151617181920
  1. // This file is subject to a 1-clause BSD license.
  2. // Its contents can be found in the enclosed LICENSE file.
  3. package cmd
  4. import (
  5. "regexp"
  6. )
  7. var (
  8. RegAny = regexp.MustCompile(`^.*$`)
  9. RegInt = regexp.MustCompile(`^[+-]?\d+$`)
  10. RegUint = regexp.MustCompile(`^[+]?\d+$`)
  11. RegFloat = regexp.MustCompile(`^[+-]?\d+(\.\d+([eE][+-]?\d+)?)?$`)
  12. RegBool = regexp.MustCompile(`^(1|0|t(rue)?|f(alse)?|y(es)?|no?|on|off)$`)
  13. RegChannel = regexp.MustCompile(`^[#&+!][^ ,:]{1,50}$`)
  14. RegMode = regexp.MustCompile(`^[+-][obveI]$`)
  15. RegUrl = regexp.MustCompile(`^https?\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]+(\:[0-9]+)?(/\S*)?$`)
  16. )