rain13 Posted July 29, 2011 Share Posted July 29, 2011 following pattern matches file name that looks like abc.df $pattern = '/\{\{(\w+\.\w+)\}\}/s'; but how can i make it mach file name hat has random number of dots in it and slash?like ./abc/def.ghany one got any ideas? Link to comment Share on other sites More sharing options...
Ingolme Posted July 29, 2011 Share Posted July 29, 2011 Instead of using \w, use the character selector: [a-zA-Z\/\.]+That selects any combination of letters, slashes and dots. Link to comment Share on other sites More sharing options...
rain13 Posted July 29, 2011 Author Share Posted July 29, 2011 tnx, I found it also works with \w+ '/\{\{([\w+\/\.]+)\}\}/s' but I dont get it why there are [] and not () ? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.