I have a function that makes a regexp for each elemnt of given array, returning array of matched elements.
The function gets array from two soures:
1. listing of a file directory (i.e. file names are in the array);
2. list of a file contents (array holds text strings of almost same file names).
OK. My problem is: the regexp matches only for case 1. and never for case 2. For example, regexp set to look for a word "mass" - array elements that came from case 2. will not match - though there is an element that holds the word, while array coming from case 1. will match. - Though all is the same - regarding the function w/ regexp - it gets array and return array.
So I conclude that the problem is in sources - file contents seems "clearer" for the regexp than dir. contents. So, I conclude some mysterious art is needed to process some invisible characters that print ">$array
$i<" does not show but regexp detects.
PS File names are from Linux EXT4 FS w/ UTF-8 encoding, if relevant.
Please, Your advice.