$re = '/\.[\w.\/-]+\.(?:xopp|xoj)/m';
$str = 'I want a regexpression that find
example)
.aaa.autosave.xopp
.high-1992.autosave.xopp
.//3/2hello.autosave.xoj
(So starting with . is also one more trait.)
However I don\'t want to match every file that ends with .xopp or .xoj
if [[ "$file_path" =~ .*\\.(xopp|xoj) && ! "$file_path" =~ /(autosave)+(.xopp|.xoj)$/i ]]
here is my trial. I write a code in bashshell.
I actually try to find the file end with .xopp or .xoj but not to find the example above , which is exactly opposite.';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php