I have string like /sdcard/filename.pdf
Can any one get me the regex to get the “filename” string from the whole path.
Thanks in adv 🙂
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.
tested online here on Rubular
The assumption is that your string is only the path.
$matches the end of the string[^\/]will match anything except/+means match the preceding character ([^\/]) at least onceSo this will match anything after the last
/in the string to the end.