in reply to regex return true instead of false

Please edit your post and show us the values of $args that match and the values that don't match.

Also, it looks as if you are trying to parse command line parameters. Have you looked at Getopt::Long?