Q&A > regular expressions > How do I escape special characters like . / or | in a regular expression? contributed by vroom
$filename=~/.*\.txt$/ # matches anything ending with .txt;
Frying pan on the stove
Results (337 votes). Check out past polls.