When I run the script on a paragraph style that contains paragraphs with quotation marks, the script returns the 000 number and not the actual page number.
Hi Avraham,
There does seem to be a strange bug in InDesign with straight quote marks and the case-insensitive switch (?i).
Do you get this problem also if you use curly quotes (“ ”) or gershayim (״)?