php regex filename

Posted by Patrick on Stack Overflow See other posts from Stack Overflow or by Patrick
Published on 2010-05-03T06:41:50Z Indexed on 2010/05/03 6:48 UTC
Read the original article Hit count: 314

Filed under:
|

Hi, anyone can help me with a preg_match? I'd like to use php's preg_match to determine if an input is a valid filename or not (only the filename + file extension, not the full path). General rules:

1) filename = a-z, A-Z, 0-9
2) extension = 3 or 4 letters

Thank you!

© Stack Overflow or respective owner

Related posts about php

Related posts about regex