07-08-2010, 02:07 PM | #1 |
Groupie
Posts: 161
Karma: 608
Join Date: Aug 2008
Location: Plano, TX
Device: Sony PRS-505 + B&N Nook + Motion LE1700 + Motorola Xoom Wifi
|
Regex engine?
Anyone know what regex engine Sigil uses?
Most normal regexes seem to work but for some reason I can't get it to like '^' for start of line. I think I need to go peruse the manual. Troy |
07-08-2010, 06:26 PM | #2 | |
Groupie
Posts: 161
Karma: 608
Join Date: Aug 2008
Location: Plano, TX
Device: Sony PRS-505 + B&N Nook + Motion LE1700 + Motorola Xoom Wifi
|
Ok, I really like the new manual. It told me exactly what I wanted to know.
Unfortunately it didn't get me what I wanted. Sigil's manual basically states the same thing as the QRegExp doc does: Quote:
Is it a line? In which case a ^ represents the start of the line. Is it a file? In which case a ^ represents the start of the file. Troy |
|
07-08-2010, 06:59 PM | #3 |
Not who you think I am...
Posts: 374
Karma: 30283
Join Date: Jan 2010
Location: Honolulu
Device: PocketBook 360 -- Ivory
|
In regex, it's usually a line. A string is a, well, string of characters.
Can you define better what it is you don't understand? |
07-08-2010, 08:01 PM | #4 | |
Groupie
Posts: 161
Karma: 608
Join Date: Aug 2008
Location: Plano, TX
Device: Sony PRS-505 + B&N Nook + Motion LE1700 + Motorola Xoom Wifi
|
Quote:
So it appears that, in Sigil, ^ does *not* refer to the beginning of the line - so what does it refer to? The docs say "beginning of string" - so what's a "string"? Is QRegExp parsing a single file as a "string"? or the whole document? Troy |
|
07-08-2010, 09:39 PM | #5 |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Well, I'm interested to see how this goes, as I'm struggling with a massive regex problem myself, albeit not yet in Sigil. But, the start of a string and the start of a line aren't the same thing. I think in regex if you only wanted to find the letter A at the beginning of a line you'd have to so indicate, whereas ^A would find any set of characters--string--that started with an A. I think. Maybe. cap will know.
|
07-08-2010, 11:21 PM | #6 |
Guru
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
|
Just a reminder that when we say "regex" there are many variants of "regular expressions" that we may be talking about. I, myself, like to think of Perl Regex, even though "that way lies madness." But at least there are definitions. If you can follow them. See, e.g. http://perldoc.perl.org/perlre.html
It all depends on what you (or your regex variant) means by "string." In PERL it usually means a "line" i.e. whatever is between two lineend characters, but that need not be the case. Sigil uses "almost" the Perl version of regex, via QT. I'm not sure how close that is to my understanding of ""regex." Is your brain melting yet? Last edited by st_albert; 07-08-2010 at 11:24 PM. Reason: clarification |
07-09-2010, 02:17 AM | #7 | |
Well trained by Cats
Posts: 29,807
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
|
|
07-09-2010, 04:45 AM | #8 | |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Quote:
And with that I leave for vacation. |
|
07-09-2010, 05:16 AM | #9 |
Not who you think I am...
Posts: 374
Karma: 30283
Join Date: Jan 2010
Location: Honolulu
Device: PocketBook 360 -- Ivory
|
If it's broken...
Hmmm. Try Code:
\nA Code:
\r\nA Just make sure to replace the \r\n when you change stuff -- it's selected, so you don't want to overwrite it and remove a carriage return. |
07-09-2010, 11:43 AM | #10 | ||
Groupie
Posts: 161
Karma: 608
Join Date: Aug 2008
Location: Plano, TX
Device: Sony PRS-505 + B&N Nook + Motion LE1700 + Motorola Xoom Wifi
|
Quote:
Quote:
But I know this guy Sed, and he's my friend. So I have an adequate work-around in place for what I needed to do. Thanks, Cap! Troy |
||
07-09-2010, 04:52 PM | #11 |
Not who you think I am...
Posts: 374
Karma: 30283
Join Date: Jan 2010
Location: Honolulu
Device: PocketBook 360 -- Ivory
|
Sounds like it's fairly-well broken then.
If you know Sed, then you're connected and we should all be asking you... |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Finding ebooks. Best engine? | rvdparis | General Discussions | 3 | 08-26-2010 03:20 AM |
Ebook Search Engine | Drezin | News | 2 | 01-05-2010 05:16 PM |
Possible scripting engine for Sigil | Valloric | Sigil | 48 | 10-17-2009 09:58 AM |
Paperback Digital's search engine | Sparrow | Workshop | 7 | 11-26-2007 11:02 AM |
Rollyo - create your own search engine | doctorow | Lounge | 0 | 09-30-2005 08:40 PM |