I’m trying to get a regex that will match:
somefile_1.txt somefile_2.txt somefile_{anything}.txt
but not match:
somefile_16.txt
I tried
somefile_[^(16)].txt
with no luck (it includes even the ’16’ record)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Some regex libraries allow lookahead:
Otherwise, you can still use multiple character classes:
or, to achieve maximum portability:
[^(16)]means: Match any character but braces, 1, and 6.