28

image Finding Single-Quoted Strings

Searching for a single-quoted text string is even more difficult, because single quotes are often used to delimit a regular expression in place. Sometimes you can use the same regex format as the double-quoted method and enclose the whole regex in double quotes. If you can’t, then the single quotes will need to be escaped as well.

Here is a sample regular expression that matches single-quoted strings. These have a single quote at each end but may not contain a quote. This search pattern is escaped so that it can be embedded into a regex that is enclosed in single quotes:

\’[^\’]*\’

Note the character range is ...

Get Developing Quality Metadata now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.