03-17-2016, 10:58 PM | #1 |
Enthusiast
Posts: 48
Karma: 10000
Join Date: Apr 2011
Device: iPad
|
Regex wildcard trouble
Hi. Time for what is probably another stupid question.
I've been loving 0.9.4 — the ability to work with ePub3 is great, and the whole app is running more smoothly for me. Except that I went to do a wildcard Regex search today — something I've done thousands of times... and it didn't behave normally. The search was Code:
mybook\.to(.*) Code:
mybook.to Code:
mybook\.to(.+) I've got all four of the check boxes selected, but I also tried turning each of them off to no avail. I'm running Sigil 0.9.4 on a Mac that sports OS X 10.11.3. (It's a MacBook Pro mid-2012 with a 2.9 GHz Intel Core i7 and 8GB of RAM, if that matters, which I am sure it doesn't.) All of the various libraries are up to date — I made sure when I undated last week. What am I doing wrong? (FWIW, I'm replacing Amazon links with links to my website so that I can use the ebook on other vendor sites. There are 84 of them; I'd really rather not go through and change them one by one. But besides, I use regex all of the time, and if it isn't going to behave, I need to find another option.) Last edited by David Kudler; 03-17-2016 at 11:02 PM. |
03-17-2016, 11:18 PM | #2 |
Well trained by Cats
Posts: 30,107
Karma: 57259780
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
can you show a full example paragraph that contains mybook dot whatever
|
Advert | |
|
03-18-2016, 12:07 AM | #3 | |
Enthusiast
Posts: 48
Karma: 10000
Join Date: Apr 2011
Device: iPad
|
Quote:
Code:
<p style="text-align: center;font-size:1.125em;"> <a href="http://mybook.to/thevisitorarrives" style="font-style: italic;"> <img alt="ThreeforThree-cover" height="120" src="../Images/Visitor-collection-1.5-cover-200.jpg" width="75"/></a> <a href="http://mybook.to/visitor-other-3somes" style="font-style: italic;"> <img alt="ThreeforThree-cover" height="120" src="../Images/the-visitor-and-other-3somes-cover-4-200.jpg" width="75"/></a> <a href="http://mybook.to/threeforthree" style="font-style: italic;"> <img alt="ThreeforThree-cover" height="120" src="../Images/ThreeforThree-take7-200.jpg" width="75"/></a> </p> Do you see anything there that might explain what's going on? I just tried Calibre... and couldn't get it to stop being greedy. Eesh. |
|
03-18-2016, 07:44 AM | #4 |
Well trained by Cats
Posts: 30,107
Karma: 57259780
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
The slash is tripping you up and needs escaping
Code:
mybook.to\/(.+?)" |
03-18-2016, 08:11 AM | #5 |
Grand Sorcerer
Posts: 27,693
Karma: 196159104
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
@OP: unchecking "Mimimal Match" allows both your expressions to work for me (the only box I have checked is "Wrap").
The only way I get your results (with your expressions) is if I check the "Minimal Match" box. @theducks: his slash in his expression is being used to escape the "." Last edited by DiapDealer; 03-18-2016 at 08:17 AM. |
Advert | |
|
03-18-2016, 10:21 AM | #6 | |
Well trained by Cats
Posts: 30,107
Karma: 57259780
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
|
|
03-18-2016, 11:02 AM | #7 |
Grand Sorcerer
Posts: 27,693
Karma: 196159104
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Yes, but that wasn't part of his expression. The slash in his sample would have been matched by the (.+) or the (.*) in his expressions. My point was that his expressions, do exactly for me, what I'm assuming he wants them to do for him--as long as "Minimal Match" is unchecked. I'm not experiencing the same behavior he is with the exact same sample/expression/settings it seems.
|
Tags |
regex, troubleshooting |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need regex help, please | magmanpi | Sigil | 13 | 08-29-2014 04:34 AM |
Regex help anyone? | seanos | Editor | 17 | 04-02-2014 11:03 AM |
Regex | Gunnerp245 | Conversion | 5 | 03-05-2012 04:15 PM |
Find and replace string with wildcard | jhempel24 | Sigil | 15 | 11-12-2010 01:50 PM |
Help with a regex | A.T.E. | Calibre | 1 | 04-05-2010 07:50 AM |