They “understand” character ranges, that is, if you wanted to match all the lower case characters, you’d use the set for lower- and uppercase characters you’d use and so on. Sets will always only match one of the characters in the set. So, for example, the set would match either the character “a”, “b” or “c”. Obviously the page number would rise from 1 to 423, thus you’d have to match 423 different strings, right? Wrong, actually: regular expressions allow you to define sets of characters that are matched: To define a set, you put all the characters you want to be in the set into square brackets. Say, as a somewhat more practical exercise, the e-book you wanted to convert had a nasty footer counting the pages, like “ of 423”. Remember where I said that regular expressions can match multiple strings? This is where it gets a little more complicated. Next is the beginning of the really good stuff.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |