Quote:
Originally Posted by rjwse@aol.com
Sometimes the simplest things really give me a kick. I use classes almost exclusively instead of styles. My CSS is a long list of classes in the main consisting of the first letter of each word in every which kind of style definition. In this way I can quickly hop and chop from this to that. I got stumped on how to use calibre's 'find' for any kind of class name consisting of one or more letters. It got lost due to being surrounded by spaces, other classes, or quotation marks. So I asked AI and it gave me: class="[^"]*X[^"]*"
I remove X and put in whatever I am looking for, then make sure the search says 'regex' instead of 'fuzzy.' I also put it in 'saved searches' in case I forget.
|
You could try this:
Exact Search (Without False Positives)
If you want to find the exact class `bc` (for example, `background-color`) and avoid finding `abc` or `bcc`, use this variation:
`class="[^"]*(^|\s)bc(\s|$)[^"]*"`
`(^|\s)`: Ensures that your class name is preceded by a quote or a space.
`(\s|$)`: Ensures that it is followed by a space or a closing quote.
Searching for Classes Starting with...`
If, on the other hand, you want to see all the classes that define something related to the border (assuming they all start with `b`), you can use:
`class="[^"]*(^|\s)b[a-z]*(\s|$)[^"]*"`