![]() |
#31 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,355
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#32 | |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
Oh, I'm sure! But for the moment it's hard for me to imagine having a need for "more" than what I've learned (or semi-learned) recently. I'd be more than happy to hear (read) an example of something "totally awesome" that you feel has applicability in coding ebooks, beyond the sort of thing that I've been doing (and that I can imagine) -- indeed, I'd love it! Inspire me! ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#33 | ||
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Quote:
In ye olden-olden days, yes, I would have tried some combination of regular searches, plus "go to next," plus manual deletion, for all of that. But when you discover that you can clean a boatload of it, using regex? Oh, baby!!! The Regex-jedis here, like Turtle, will have other examples, I'm sure. I'm dashing out today, (<grumble, more medical torture>) so I'm not leaving actual EXAMPLES--shame on me--but I have faith in my brothers of the regex-sword. There's almost NOTHING that excites a good display of showmanship (or showomanship) around here like a regex example! (Also--hath thee not gone by the regex pinned thread???? Twooly?) Hitch |
||
![]() |
![]() |
![]() |
#34 | |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
I realize that I'm undoubtedly over-simplifying my explanation here, but surely you know what I mean -- it's that "auto-tokenise" feature in Sigil that just totally makes things SO much easier, virtually a breeze. ![]() Last edited by Psymon; 07-13-2016 at 02:02 PM. |
|
![]() |
![]() |
![]() |
#35 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,355
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Why thank you! But I can't claim having reached that exalted status.
![]() I am still getting stuck on negative lookbacks. I know they can save me so much time, but I just end up doing 3 or 4 passes instead. ![]() The Regex examples thread is definitely helpful! |
![]() |
![]() |
Advert | |
|
![]() |
#36 | |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,549
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
. : any character + : any number of times (but at least one) ? : but as few as as possible, as long as the rest of the expression still matches ( ) : and put it in a group, so it can be referred to as \1, \2, etc. |
|
![]() |
![]() |
![]() |
#37 | |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Firstly (and briefly) to Turtle...
What's the "Regex examples thread"? I did a search of the forums here for "regex examples" but didn't find anything. Also, from Jellby... Quote:
![]() I'm not quite sure that I understand the "? : but as few as as possible, as long as the rest of the expression still matches" part, though -- in what sense as few as possible? Couldn't it go on (and on and on, ad infinitum) until it hits the next part of the matching string -- wouldn't it do that without the "?" in there anyway, just stop at that part (the next matching bit)? ![]() Perhaps I'm overcomplicating this -- the simple answer, for my needs, is that "(.+?)" does the trick! ![]() |
|
![]() |
![]() |
![]() |
#38 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,533
Karma: 78910202
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
See Regex examples
|
![]() |
![]() |
![]() |
#40 | ||
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
Quote:
I did start to read the posts on that Regex examples thread -- got through the first page but then began to develop a headache and had to stop. ![]() Ha ha, I'll take another look again later, and browse through it some more, and I also subscribed to that thread, too, and so hopefully, over time, things will start to sink in. It's strange how I've always seemed to struggle with "programmy"-type stuff like this, it's as though there's a "mental block" in my brain and I'm just not really built for it. ![]() ![]() But anyway, not to belabour my reply here, I think I am beginning to see how I could make use of much more Regex knowledge than simply "(.+?)" -- although I do gotta say that just that, and "\1," "\2," etc., in tandem with the auto-tokenise feature in Sigil, has already truly rocked my world! ![]() Thanks again, guys! I'm a slow learner (about Regex, anyway), but hopefully over time I'll get it. ![]() (PS. Totally off-topic to this thread, but is there any way to get email notifications for every post to a thread one is subscribed to in these forums? I often like to save emails with info that I might want to find again later, but I only seem to get notification that there's something new that's been posted -- and then discover that there have, in fact, been two or more things posted. It would be great if I could get emails for all posts, though, instead.) |
||
![]() |
![]() |
![]() |
#41 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,355
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
eg string searched: "Hello my name is Inigo Mantoya, son of Hector Mantoya." find: "name is (.+) Mantoya" or "name is (.*) Mantoya" is a greedy find...it will match as much as possible and still meet the criteria: "name is Inigo Mantoya, son of Hector Mantoya" find: "name is (.+?) Mantoya" or "name is (.*?) Mantoya" is a non-greedy find... it will match on only the first qualifying match "name is Inigo Mantoya" Hopefully that's clearer than mud! |
|
![]() |
![]() |
![]() |
#42 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regex help anyone? | seanos | Editor | 17 | 04-02-2014 11:03 AM |
New help with a regex | txckie | Calibre | 2 | 08-29-2011 08:46 PM |
Help me with regex please. | eVrajka | Library Management | 5 | 08-15-2011 12:17 PM |
What a regex is | Worldwalker | Calibre | 20 | 05-10-2010 05:51 AM |
Help with a regex | A.T.E. | Calibre | 1 | 04-05-2010 07:50 AM |