Hexpress example for detecting image extension
IMAGE_EXTENSION_RE = Hexpress.new.either(['jpg', 'png', ..etc]).ending.to_r
Just implemented it and thought would be nice to post in case someone can spot flaws.
Written by Dimitrios Mistriotis
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#