This is a discussion on "regular expressions to parse" within the JavaScript Forum section. This forum, and the thread "regular expressions to parse are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
regular expressions to parse
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
regular expressions to parse
I'm working on regular expressions to parse html tags into the wiki syntax. i.e. for example, if i encounter text like - some <b> more </b> text, my regular expression should be able to convert that to some 'more' text. Simple things like the above, i was able to write but the real problem lies when it comes to parsing lists and tables.
For example, i write down some text as follows - # number one # number two # number three i want to be able to convert that into html code - <ol> <li>number one</li> <li>number two</li> <li>number three</li> </ol> i was able to find out the first occurance and last occurance of #, append a <ol> there and get the number one/two/three within <li></li>. So far so good...But the problem occurs when i have multiple lists on the same page. Obviously, my search for the first and last occurance of # will not be as desired as there are two lists in the page. i.e. # number one # number two some text here # number one # number two then unfortunately my parsing into html yields me <ol> <li>number one</li> <li>number two</li> some text here <li>number one</li> <li>number two</li> </ol> and not as <ol> <li>number one</li> <li>number two</li> </ol> some text here <ol> <li>number one</li> <li>number two</li> </ol> Can anybody help??? I'm trying out the above using VB.Net as well as javascript. So any help in either of the languages is most welcome... |
|
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unicode Regular Expression won't work ?? | stacioanri | JavaScript Forum | 2 | Jul 28th, 2007 21:52 |
| Extract attribute value with Regular Expression? | ScottDC | PHP Forum | 2 | May 18th, 2007 08:37 |
| Help spliting string by regular expression | Sagaris | PHP Forum | 8 | May 1st, 2007 20:46 |
| PHP & newlines Refular expressions | ktsirig | PHP Forum | 1 | Feb 12th, 2006 18:27 |