javascript doubt

Hi all
I have one doubt when i am writing following javascript i am able to get only file name should not entered wrongly

var lv_item_file_name=/([^/]+).(asp|html|htm|shtml|php)$/i;

Now what i want is
along with this file name proper or not validation i should able to enter # if i don’t have filename

How to write that

in javascript validations

using the below problem solved

var lv_item_file_name=/^[A-Za-z]{1}[A-Za-z_0-9]*[.][phpPHP]|#$/;