SHORT AND SWEET VERSION:
I need to get a regular expression that will find any filenames in a document with the extension ".esp" and will work with PHP.
LONG WINDED VERSION:
I'm currently trying to develop a PHP friendly regex expression to search a document and find all files of a specific extension... The file names are surrounded by non ASCII characters which might be why i'm having this problem.
Basically i need to do one of two things (or both!):
- Remove all non ASCII characters from the document
- Just pick out the file names while ignoring the non-ASCII characters
Here is a function i've found to work when testing on an online regex tester:
[0-9a-zA-Z-'_. ]*\.esp
This does not, however work when putting it into my script. I eaither get an error with preg_replace about the (or . or even +), or I get NO error but no results with ereg(). wonders if i need a special library or something*
Anyway if you guys could help that would be great.