Module: Format
- Defined in:
- lib/format.rb
Constant Summary
- EMAIL =
/^[_a-z0-9\+\.\-]+\@[_a-z0-9\-]+\.[_a-z0-9\.\-]+$/i- PASSWORD =
/^[\_a-zA-Z0-9\.\-]+$/- FILENAME =
matches everything to the last \ or / in a string. can chop of path of a filename like this : '/tobi/home/tobi.jpg'.sub(/^.*/,'') => tobi.jpg
/^.*[\\\/]/- FILENORMAL =
good for replacing all special chars with something else, like an underscore
/[^a-zA-Z0-9.]/- IP_ADDRESS =
Laxly matches an IP Address , would also pass numbers > 255 though
/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/- HTTP_URI =
Laxly matches an HTTP(S) URI
/^https?:\/\/\S+$/