Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


regexp find and seperate custom tags in a string



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
Chippo



Joined: 22 Apr 2008
Posts: 1

PostPosted: Tue Apr 22, 2008 11:43 pm    Post subject: regexp find and seperate custom tags in a string Reply with quote

Hi
I am working on a CMS system for myself, Im having a bit of trouble with some reg exp.
Say i have a text string like this...
Code:
{{startcontent_categories_box}}blah blah blah<br />
<br />
$p</p>
<table cellspacing="1" cellpadding="1" width="200" border="1">
    <tbody>
        <tr>
            <td>username</td>
            <td>password</td>
        </tr>
        <tr id="rowstart">
            <td style="width: 250px"><strong>$username</strong></td>
            <td style="width: 250px">$userpassword</td>
        </tr>
    </tbody>
</table>
<p><br />
{{endcontent_categories_box}}


what I want to be able to do is run a reg exp which will find things like this on the page for me and seperate the content name, the start and end tags and the content within them.
content name would be 'categories_box'
start tag would be {{startcontent_categories_box}}
end tag would be {{endcontent_categories_box}}
and the content within would be all the html between the 2 tags.

Is this possible?

I have been trying myself but I am useless when it comes to reg exp, what I tried was...
Code:
/{{startcontent_/\d{2,50}/}}(.*?){{endcontent_/\d{2,50}/}}$/mg


If someone could help me with this it would be greatly appreciated
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap