How do i write a regex to match anything ending with a number, then .jpg.
E.g:
10021321.jpg MATCH
1231.jpg MATCH
xxx.jpg NO MATCH
123123-resized.jpg NO MATCH
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.
will do this. This allows any characters before the final number +
.jpg.Edit: Since you only want to allow numbers and nothing else in the filename, use
(but this is not what you’re actually asking in your question).