|
-
Nov 3rd, 2008, 09:12 PM
#1
Regular Expressions and BBCode Parsing
I'm working on a small feature for one of my websites that involves basic BBCode parsing and I'm having difficulty getting it to work 100%.
Basically I'm trying to use Regular Expressions for the matching but certian ones don't seem to always match correctly.
For example, I use the following Regular Expression Pattern for figuring out where the [code][/code] tags are and replace them:
Code:
"\[code\](.+?)\[\/code\]"
I'm not very good with regular expressions so if anyone can tell me why this doesn't always pick up on the code tags correctly or if anyone can recommend an application that can help generate regular expression patterns it would be really helpful!
-
Nov 3rd, 2008, 11:04 PM
#2
Fanatic Member
Re: Regular Expressions and BBCode Parsing
I am not sure if you can use this or if its even relevant to you. Today I was working with Regex and headed over to MSDN for documentation when I found out that there are already many derived classes from Regex class.
Maybe this is some help to you:
http://msdn.microsoft.com/en-us/libr....tagregex.aspx
-
Nov 3rd, 2008, 11:42 PM
#3
Re: Regular Expressions and BBCode Parsing
Actually that's pretty cool. That might work much better. Thanks!
Actually, now that I looked at it, it looks like it only works with tags that have already been created so this won't work for me. I can't seem to find a good set of BBCode regular expressions.
Last edited by Kasracer; Nov 4th, 2008 at 12:31 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|