gijew Posted May 2, 2008 Share Posted May 2, 2008 I've been working on this all morning and I finally got myself to a point where I'm ready to start doing hello world scripts again What should have been easy has turned into a chore. The basics are I'm uploading files to a directory. I want to check if the file exists in the directory. If it does, I want to see what the final count is and increment to the next one. That's where I've been working on my regex. I'm not strong but I have an okay understanding. // SAMPLE test.txt test (1).txt test (2).txt // REGEX ([a-zA-Z0-9]+)\s\(([0-9]+)\).([a-z]+) That will match test (1).txt and test(2).txt. I need incorporate the "test.txt" without the auto_increment. How can I do that? Link to comment https://forums.phpfreaks.com/topic/103913-incrementing-file-number-if-filex-exists/ Share on other sites More sharing options...
gijew Posted May 2, 2008 Author Share Posted May 2, 2008 Stupid me. Newb. ([a-zA-Z0-9]+)(.([a-z]+))|(\s+\(([0-9]+)\).([a-z]+)) Link to comment https://forums.phpfreaks.com/topic/103913-incrementing-file-number-if-filex-exists/#findComment-531965 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.