10-08-2011, 01:16 PM | #1 |
Enthusiast
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 |
10-09-2011, 11:33 AM | #2 |
Reader
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.
|
Advert | |
|
10-09-2011, 02:03 PM | #3 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Jun 2010
Device: none
|
Thanks for the reply
But what is emacs? |
10-09-2011, 07:31 PM | #4 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
10-09-2011, 08:20 PM | #5 |
Grand Sorcerer
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
|
yup
|
Advert | |
|
10-09-2011, 09:51 PM | #6 | |
Well trained by Cats
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:
did everything with EMACS: Write programs, send mail, make Pizza Me I was lucky to save my file without introducing more errors |
|
10-10-2011, 03:30 AM | #7 | |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Quote:
<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. |
|
10-10-2011, 05:51 AM | #8 |
Reader
Posts: 519
Karma: 24612
Join Date: Aug 2009
Location: Utrecht, NL
Device: Kobo Aura 2, iPhone, iPad
|
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.
|
|
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 |