in reply to Re^4: Regex problem
in thread Regex problem

I think the program is doing what you described, but I did find your description a bit difficult to understand. It might help to clarify your requirements if you answered the following questions.

Do you want the text at the position indicated in file1 or do you want the text after the string "FAN"?

If you want the text at the position indicated in file1 rather than the text after the string "FAN", why do you want to search for the string "FAN"?