|01-08-2010, 06:52 AM||#1|
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
Help with Regular Expressions
I keep hearing about regular expressions and have seen some of the regular expressions in threads on this site, but unfortunatly they doen't make a lot of sense.
Could someone explain to me just what they are and how to use them?
Also what would the benefit be in using them?
|01-08-2010, 08:30 AM||#2|
Join Date: Sep 2008
Device: Nokia 770 (fbreader)
It's basically recognizing patterns.
If you can tell a program to look for patterns, you can have the program change or record or reproduce or whatever you want it to do.
Typically, they're used for search and replace operations -- including replacing with nothing (thus deleting.)
Imagine you have a text file: in that file are recurring lines that have a single number (page numbers, for instance.) They don't add anything to an ebook, in fact they interrupt the reading experience:
blah blah blah I'm a great shaper of words blah 214 blahbety blah geflugehh cthulhu
Once you get familiar with the symbols, you can identify any recurring pattern and, as you get more sophisticated, you can extract information from those patterns and restructure and replace it.
It's really worth learning, especially if you are doing proofreading and editing of texts.
m a r
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Problem with regular expressions||Manichean||Conversion||10||02-03-2011 03:27 PM|
|Custom Regular Expressions for adding book information||bigbot3||Calibre||1||12-25-2010 07:28 PM|
|Regular expressions, Calibre and you- an introduction (Archived)||Manichean||Conversion||80||11-11-2010 08:37 AM|
|Regular Expressions help needed||Phil_C||Workshop||20||10-03-2009 01:14 AM|
|BookDesigner v5 and regular expressions||ShineOn||Sony Reader||11||08-25-2008 05:06 PM|