Regex to detect filesystem path values
Posted: Tue Jul 31, 2007 9:19 am
I constructed the following regex to detect filesystem path values.
these path values are randomly present in a log file and they are embedded inside single quotes.
some thing like this:
this is the project path: '/usr/share/project/'
Assumptions:
No special chars will be there in the filesystem path that is: (~!@#$%^&*():;''><.,/?)
comments Please, so that I can optimize further.
these path values are randomly present in a log file and they are embedded inside single quotes.
some thing like this:
this is the project path: '/usr/share/project/'
Assumptions:
No special chars will be there in the filesystem path that is: (~!@#$%^&*():;''><.,/?)
Code: Select all
\'(\/+[\w-_.\s]{1,255})+\'comments Please, so that I can optimize further.