Quote:
Originally Posted by mightymouse2045
Thanks alot for your explanation - that worked a treat  I can now do that with anything else in future 
|
Complicated regular expressions (like the one above) can be quite ... intimidating. This is because the Regular Expression language is very, very condensed and has developed during many years, so some metacharacters need to be "escaped", others not, and syntax is different for traditional metacharacters and different for relatively recently introduced ones. The syntax can change from tool to tool.
If you "take the RE apart", like I did above, it becomes much clearer.
As I said, the RE language is very "dense", so such expressions are very often jokingly referred to as "write only". It means it can be easier to write it than understand expression that somebody else wrote.
I strongly recommend that you read following post
https://www.mobileread.com/forums/sho...d.php?t=118569
It is a result of very interesting thread that was started by Manichean, with many contributors and is now part of the Calibre documentation.
If you are interested in further learning, get a book called Mastering Regular Expressions by By Jeffrey E.F. Friedl.