Posted By

lagrangeapex on 12/12/07


Tagged

html id heading


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

basicmagic
wbowers


Give headings IDs


 / Published in: Regular Expression
 

Convert headings to have id's with the content of the heading

  1. Find:
  2. (<h[1-6])(>)(.+)(</h[1-6]>)
  3. Replace:
  4. $1 id="$3"$2$3$4
  5.  
  6. Turns
  7. <h4>Foobar</h4>
  8. into
  9. <h4 id="Foobar">Foobar</h4>

Report this snippet  

You need to login to post a comment.