Thread: Regex help...
View Single Post
Old 04-26-2009, 02:22 PM   #5
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,556
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
With vim's regexp, I'd do:

Page numbers in the format (1 of 251): (\d\+ of \d\+)

Secondly, time/date eg [4/24/2009 10:29:37 PM]: \[4\/24\/2009 \d\+:\d\+:\d\+ [AP]M\]

where:

\d\+: one or more digits
\[, \], \/: literal [, ], or /
[AP]: A or P

And from Nate's reply, I guess for BookDesigner:

\([0-9]{1,3} of [0-9]{1,3}\)
\[4/24/2009 [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [AP]M\]

Last edited by Jellby; 04-26-2009 at 02:24 PM.
Jellby is offline   Reply With Quote