Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-19-2011, 03:03 PM   #1
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 541
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Samsung Galaxy Tab 4 Nook & Samsung Galaxy Tab S 10.5
Help with regex POSIX class search

Maybe it would be a good idea for a whole subforum related to regex searching!

I'm stuck on yet another regex search. I'm trying to find any punctuation characters that don't have a space following them. Looking at my regex cheatsheet, it looks like I should be able to do this with a POSIX class search. I've tried [:punct:]\S but it doesn't seem to work. Instead, this search shows me every occurrence of the letters p, u, n, c & t that aren't followed by whitespace. Pretty much, it's doing the same as a grouping, like [punct]\S. It's like Sigil isn't paying any attention at all to the fact that there are colons in the search string.

Am I missing something or doing something completely wrong here?

Any assistance would be most appreciated.

Thanks.

- Byron

Last edited by bfollowell; 05-19-2011 at 05:05 PM.
bfollowell is offline   Reply With Quote
Old 05-20-2011, 01:50 AM   #2
huebi
Zealot
huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!
 
Posts: 121
Karma: 5070
Join Date: Dec 2010
Device: none
Code:
:punct:
is not available in Sigil. use something like [.,!?]
huebi is offline   Reply With Quote
Advert
Old 05-20-2011, 04:10 AM   #3
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I believe Sigil uses QRegExp at the moment.
Jellby is offline   Reply With Quote
Old 05-20-2011, 04:37 AM   #4
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 541
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Samsung Galaxy Tab 4 Nook & Samsung Galaxy Tab S 10.5
Thanks for the info guys. I'll find a workaround like you mentioned huebi. When you say it isn't available in Sigil, do you mean the punct search or POSIX class searches in general?

Jellby, thanks for the QRegExp reference. I'm sure it will come in handy.

I really appreciate your guys' help.

- Byron
bfollowell is offline   Reply With Quote
Old 05-20-2011, 01:57 PM   #5
Faster
Connoisseur
Faster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of light
 
Posts: 61
Karma: 12096
Join Date: Sep 2010
Location: Tasmania
Device: Sony PRS 650
POSIX is not implemented in Sigil. In this case it wouldn't help you anyway unless you are planning on doing a one-by-one replacement rather than Replace All.
Think what would happen to this: "Hello!"
My guess is that it would become " Hello! "

Try this for your search:
Find: ([^\nA-z0-9 -“/])([^ \n”])
Repl: \1 \2
In the Find string there is a space between the 9 and the dash. See below for quotes.
In the Repl string there's a space between the \1 and \2.
You will need to tweak it to suit your needs by adding, in the Find string, any punctuation you do not want followed by a space.
For example if you're using it in Code View then use this Find string: ([^\nA-z0-9 -“/<>])([^ \n”]) to avoid angular brackets having spaces added after.
The problem is quotes. If you can, make the double quotes curly - the first one of the type that occurs at the start of a quote (opening) and the second one of the type that ends a quote (closing). The text being searched must also have curly quotes.
Interestingly the search string does not find square brackets or the '&' not followed by a space. Sort of convenient!

Last edited by Faster; 05-20-2011 at 02:36 PM.
Faster is offline   Reply With Quote
Advert
Old 05-20-2011, 03:42 PM   #6
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 541
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Samsung Galaxy Tab 4 Nook & Samsung Galaxy Tab S 10.5
Quote:
Originally Posted by Faster View Post
POSIX is not implemented in Sigil. In this case it wouldn't help you anyway unless you are planning on doing a one-by-one replacement rather than Replace All.
Think what would happen to this: "Hello!"
My guess is that it would become " Hello! "
Faster,

This wouldn't be a problem for me as I didn't plan to batch correct in this instance; only investigate. Thanks for your advice though. I'll look it over and try it out.

- Byron
bfollowell is offline   Reply With Quote
Old 05-21-2011, 06:16 AM   #7
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
NB sometimes it is correct for there not to be a space after a punctuation mark as in thre "hello!" example above, or as in
"right," said Fred

the "rule" may be that punctuation should be followed either by a space or by a quote mark, but initials may be another exception : J.B.Lenoir or J. B. Lenoir ?
cybmole is offline   Reply With Quote
Old 05-21-2011, 10:55 AM   #8
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Or numbers: 3.1416
Or parentheses: (Like this.)
...
Jellby is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-650 SD Card Importance? SDHC, SDHC Class 4, Class 10 etc is it important Renji Sony Reader 11 12-03-2011 12:30 PM
Strange behavior with advanced catalog search (regex) QuantumBeep Library Management 1 02-21-2011 11:06 AM
need regex help search and replace schuster Calibre 4 01-10-2011 09:00 AM
Regex search author field to locate books? Starson17 Calibre 2 12-21-2009 10:40 AM
regex search for roman numerals Blurr Calibre 2 12-16-2009 05:55 PM


All times are GMT -4. The time now is 09:20 PM.


MobileRead.com is a privately owned, operated and funded community.