it finds all occurrences except first here:
Division of Motor Vehicle (DMV) <-- no italics
Book title (extra detail) <--- italics
Book title (Extra Detail) <--- italics
Book title (Division of Motor Vehicle) <--- italics
PERFECT! Thank you Winterm.
1 person found this helpful
Sorry! Not correct.
Book title (Division of Motor Vehicle, DMV)
Hey, Obi-wan, it's not a bullet-proof solution for tutorial, after all.
when it covers real-world OP's request, then it's enough...
why search for things that never happen?
"Less is More"
Only a bullet-proof grep with no false positive and no false negative hits is a good grep
keep cool. It's only a big sandbox.
btw please replace the + in your own grep in post #1 with +? for this following case which is never happens:
Book title (Division of Motor Vehicle) Book title (extra detail)
Keep Cool! Do you really understand what you mean with:
You only say that you italicize all content between parenthesis whose last char is not a capital!! [pixxxel ( ) is totally right about +?]
… won't be taken by your code! … but not:
When I read Bob's question:
… "I don't want to Italicize the content and parenthesis when it is an acronym."
That simply means:
Bob wants to italicize all content between parenthesis only if this content is not a group of capitals!
… so, only if the "entering" parenthesis is not followed by capitals and a "closing" parenthesis!!
Do you really understand what you mean...
Yes, I do. Agreed, one may find such approach rather strange, but it works on OP samples. I listed cases it covers - don't you find it fair enough? That said, I have learned not answer the questions I wasn't asked. Your life experience may be different.
So: (in US) … won't be taken by your code!
So what? It's not here in the samples OP provided. I guess it's possible to invent scenarios which even Your smart code won't cover - then you'll need even more gorgeous one, and that's no surprise.
Pixxxel's addition is useful to restrict the GREP greediness. Seems like it's not the case in OP's text, so I omitted it. Would there be any harm of adding it? No!
Your codes cover much wider area, still aren't something worth to save for future reference. It's still kind of "use it once and throw away".
IMHO, nobody's really right or wrong here, it's just a matter of POV, so I find this further discussion rather pointless.
Peace and Merry Christmas to everyone
It's very easy to self-define the cases!
"It works in this case, this one … and this other one! …
If it doesn't work in that case, it's not a problem … because I don't care of it!!"
"Italicize all text between parenthesis except acronyms" was the question I've read.
Your interpretation is not mine!
Sorry to have contradicted you, but I don't think like you and I don't use Grep in your way!!