Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-08-2011, 01:16 PM   #1
soparch
Enthusiast
soparch began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Jun 2010
Device: none
Sequential numbers regex?

Hello,
I wondered if anyone out there could help me. I want to be able to mark some tags up with sequential numbers and I wondered if this was possible with regular expressions.
What I want is for example to replace say

<p> with <p id="1"> <p id="2"> and so on etc, etc

I know nothing about regex's so any help would be appreciated.
Thanks
soparch is offline   Reply With Quote
Old 10-09-2011, 11:33 AM   #2
pietvo
Reader
pietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notes
 
pietvo's Avatar
 
Posts: 519
Karma: 24612
Join Date: Aug 2009
Location: Utrecht, NL
Device: Kobo Aura 2, iPhone, iPad
Regular expressions cannot generate sequential numbers. With Emacs you would be able to do this.
pietvo is offline   Reply With Quote
Advert
Old 10-09-2011, 02:03 PM   #3
soparch
Enthusiast
soparch began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Jun 2010
Device: none
Thanks for the reply
But what is emacs?
soparch is offline   Reply With Quote
Old 10-09-2011, 07:31 PM   #4
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by soparch View Post
Thanks for the reply
But what is emacs?
The most complicated, convoluted, worst text editor ever created.
user_none is offline   Reply With Quote
Old 10-09-2011, 08:20 PM   #5
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,886
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
Wink yup

Quote:
Originally Posted by user_none View Post
The most complicated, convoluted, worst text editor ever created.
alansplace is offline   Reply With Quote
Advert
Old 10-09-2011, 09:51 PM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,973
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by user_none View Post
The most complicated, convoluted, worst text editor ever created.
One of the Software Guru supporting the DEC 2060 (that should date it )
did everything with EMACS: Write programs, send mail, make Pizza
Me I was lucky to save my file without introducing more errors
theducks is offline   Reply With Quote
Old 10-10-2011, 03:30 AM   #7
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by soparch View Post
Hello,
I wondered if anyone out there could help me. I want to be able to mark some tags up with sequential numbers and I wondered if this was possible with regular expressions.
What I want is for example to replace say

<p> with <p id="1"> <p id="2"> and so on etc, etc

I know nothing about regex's so any help would be appreciated.
Thanks
In epp:
<p id="%MATCHN%">
Perhaps your editor has something similar.

An id should begin with an alpha character so the statement would be something like:
<p id="CH_%MATCHN%">

PS: Most Grep tools have a numbering cpability.

Last edited by crutledge; 10-10-2011 at 03:41 AM.
crutledge is offline   Reply With Quote
Old 10-10-2011, 05:51 AM   #8
pietvo
Reader
pietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notes
 
pietvo's Avatar
 
Posts: 519
Karma: 24612
Join Date: Aug 2009
Location: Utrecht, NL
Device: Kobo Aura 2, iPhone, iPad
Quote:
Originally Posted by user_none View Post
The most complicated, convoluted, worst text editor ever created.
I thought this couldn't be true because every true description of Emacs has to match the regular expression “.*e.*m.*a.*c.*s.*”. But I checked it (with Emacs of course) and lo and behold, it matches. Ideally these letters should match at the beginning of words so it still falls short.
pietvo is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RegEx: Removing Page Numbers that have Spaces captainslow Conversion 2 02-27-2011 04:14 PM
Is there a hack for displaying page numbers rather than location numbers? nesler Kindle Developer's Corner 16 02-15-2011 12:00 AM
Help with regex to remove specific strings of numbers adrian1944 Conversion 9 02-14-2011 01:11 PM
My RegEx isn't doing what I hoped to remove page numbers and a fixed string winterminute Calibre 6 12-19-2010 10:55 PM
Regex help... Bobthebass Workshop 6 04-26-2009 03:54 PM


All times are GMT -4. The time now is 09:31 AM.


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