\b means approximately "word boundary". Any white space character (space or \n or other such character like \t) satisfies that boundary condition. End of the string also satisfies that boundary condition (i.e. having no character following ".htm").
What do you mean by " so the /b didn't work all the time"?
Look carefully and make sure that there is no space before the \b in:
if (my ($doc_title) = $line=~ m/<FILENAME>(.*\.htm)\b/) {
In reply to Re^5: pattern matching once
by Marshall
in thread pattern matching once
by justin423
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |