I added ? after \. and after the extensions in the () of level 3 but it doesn't catch. I tried the same regex with sed and it found all the posibilities (wechall,wechall4,wechall.ext, wechall4.ext). What's wrong?
Also there'a a bug, when you use [, [], more then 3 ? in a row, or any char that isn't a modifier as a modifier, the script doesn't filter it and spits out a preg_match error.