What language is it in? And indicate the code, please; with an anchor ^ you should definitely only match the line starting with BookTitle, so something else is wrong. If you can guarantee that all spaces are removed from the titles, as in your examples, then ^BookTitle:(\S+) should work in many languages.
Explanation:
^ requires that the match starts at the beginning of the line, as you know.
\s - * lower * case means: match on white * s * pace (space, tab, etc.)
\s - * upper * case means the opposite: a match on nothing, but in a space.
\w is another possibility: matching the character * w * ord (alphanumeric plus underscore) - but this will not help you if, for example, there is an apostrophe in the name.
+ , as you know, is a quantifier meaning "at least one of."
Hope this helps.
Edward
source share