How can I use regex to add css to chapter & verse numbers?
Posted: Wed Apr 08, 2009 10:36 pm
Hello,
I'm using Dreamweaver CS4. I'm fairly new at it. I'm comfortable using find and replace but I have never had to use Regex before.
I'm working on a copy of the New Testament. I want to use a CSS style to change the appearance of the chapter and verse numbers.
As you know there is a chapter number, then a colon, then a verse number. There are four combinations of numbers. Examples are: 1:1, 1:10, 10:1 and 10:10
What I want to do is wrap this CSS style "<span class="VerseNumbers"> </span>" around each set of numbers. The numbers need to be left unchanged, I just want to add the CSS.
Example:<span class="VerseNumbers">10:10</span>
Here is a copy of the source code before any changes.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
from the east to Jerusalem.<br />
2:2 Saying, Where is he that is born king of the Jews? For we have seen his star in the east and have come to adore him.<br />
2:34 King Herod hearing this, was troubled and all Jerusalem with him.<br />
12:4 Assembling together all the chief priests and the scribes of the people, he inquired of them where Christ should be born.<br />
12:56 But they said to him, In Bethlehem of Judea. For so it is written by the prophet,<br />
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is what it should look like after adding the CSS.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
from the east to Jerusalem.<br />
<span class="VerseNumbers">2:2</span> Saying, Where is he that is born king of the Jews? For we have seen his star in the east and have come to adore him.<br />
<span class="VerseNumbers">2:34</span> King Herod hearing this, was troubled and all Jerusalem with him.<br />
<span class="VerseNumbers">12:4</span> Assembling together all the chief priests and the scribes of the people, he inquired of them where Christ should be born.<br />
<span class="VerseNumbers">12:56</span> But they said to him, In Bethlehem of Judea. For so it is written by the prophet,<br />
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I've done some reading about regular expressions, but I have had no success in figuring out how to make it work for my particular need. I keep wiping out the numbers. I sure hope it can be done. I'm looking at a LOT of numbers to change.
Any advice would be greatly appreciated.
Thanks.
I'm using Dreamweaver CS4. I'm fairly new at it. I'm comfortable using find and replace but I have never had to use Regex before.
I'm working on a copy of the New Testament. I want to use a CSS style to change the appearance of the chapter and verse numbers.
As you know there is a chapter number, then a colon, then a verse number. There are four combinations of numbers. Examples are: 1:1, 1:10, 10:1 and 10:10
What I want to do is wrap this CSS style "<span class="VerseNumbers"> </span>" around each set of numbers. The numbers need to be left unchanged, I just want to add the CSS.
Example:<span class="VerseNumbers">10:10</span>
Here is a copy of the source code before any changes.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
from the east to Jerusalem.<br />
2:2 Saying, Where is he that is born king of the Jews? For we have seen his star in the east and have come to adore him.<br />
2:34 King Herod hearing this, was troubled and all Jerusalem with him.<br />
12:4 Assembling together all the chief priests and the scribes of the people, he inquired of them where Christ should be born.<br />
12:56 But they said to him, In Bethlehem of Judea. For so it is written by the prophet,<br />
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is what it should look like after adding the CSS.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
from the east to Jerusalem.<br />
<span class="VerseNumbers">2:2</span> Saying, Where is he that is born king of the Jews? For we have seen his star in the east and have come to adore him.<br />
<span class="VerseNumbers">2:34</span> King Herod hearing this, was troubled and all Jerusalem with him.<br />
<span class="VerseNumbers">12:4</span> Assembling together all the chief priests and the scribes of the people, he inquired of them where Christ should be born.<br />
<span class="VerseNumbers">12:56</span> But they said to him, In Bethlehem of Judea. For so it is written by the prophet,<br />
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I've done some reading about regular expressions, but I have had no success in figuring out how to make it work for my particular need. I keep wiping out the numbers. I sure hope it can be done. I'm looking at a LOT of numbers to change.
Any advice would be greatly appreciated.
Thanks.