c# - Regex to determine if a file is a rar file -


I'm trying this myself, but I'm taking it a little longer ..

Actually following a regex to pass the following tests:

  IsararFile ("test.rar"); // True IsararFile ("test.r00"); // True Isararfile ("test.txt"); // false isarfile ("test.avi"); // false IsararFile ("test.mp4"); // false isarfile ("test. 001"); // True IsararFile ("test.ba00"); // false  

Thanks for any help

 < Code> <. (?:? Rar | r \ d \ d | \ d \ d \ d) $  

I think.

EDIT: Peter credits another improvement.


Comments