1

I'm using REGEX to find strings within specific parameters, for example:

<p>*(.+?)</p>

I would like each instance found to be replaced with a progressively increasing letter of the alphabet. So the first instance becomes <p>A</p>, the second becomes <p>B</p>, then <p>C</p>, etc. through the end of the document. Is this possible?

b_q
  • 27
  • 1
  • Are you using Javascript for this? – jdaz Jul 12 '20 at 01:25
  • 2
    What language are you using? – Sweeper Jul 12 '20 at 01:26
  • The document is in HTML. I'm using an ebook software called Sigil which has a REGEX find/replace feature. – b_q Jul 12 '20 at 01:31
  • `>*`? *Really??* You want it to match 0 to many `>` characters? E.g. ``, `

    A

    `, `

    >A

    `, `

    >>A

    `, ...
    – Andreas Jul 12 '20 at 02:34
  • 1
    sounds like a job for an actual programming language, preferably with an html parser unless the html is extremely restrictive and always near constant. Not a job for regex – Chase Jul 12 '20 at 06:35
  • 1
    https://textpad.com/products/textpad/features supports `\i` as regex replacement for an auto incremented number - so far the only product where I've seen such a thing and somewhat the closest to what OP wants without programming it himself. – AmigoJack Jul 12 '20 at 07:48
  • 1
    No, it is not possible with regex. – Wiktor Stribiżew Jul 12 '20 at 08:56

0 Answers0