|
-
Jun 28th, 2011, 09:21 AM
#1
Thread Starter
Junior Member
Help newbie with Ragex (easy)
Hello
i use such code for html strip
Code:
strOutput = Regex.Replace(InpData, "<[^>]*>", "")
but i need to get rid of things like (all are in 1 string)
Code:
.thead a:link, .thead_alink
(starts with dot ends with newline?)
Code:
a:hover, a:active, body_ahover
(starts with character followed by ":" ends with newline?)
i would like to use same method as above Ragex code but i have no idea how to work with it (its so complicated...).
-
Jun 28th, 2011, 02:05 PM
#2
Re: Help newbie with Ragex (easy)
Do you mean you want to get rid of the entire stylesheet? You would do this, then:
Code:
strOutput = Regex.Replace(InpData, "<style[^>]*>.+?</style>", "")
strOutput = Regex.Replace(strOutput, "<[^>]*>", "")
Last edited by minitech; Jun 28th, 2011 at 04:23 PM.
-
Jun 28th, 2011, 04:15 PM
#3
Thread Starter
Junior Member
Re: Help newbie with Ragex (easy)
Im getting error something like
System.ArgumentException was unhandled
Message= analyzing "<style[^]*>.+?</style>" - Unterminated [] set.
if i add > after ^ it appears to work but i still get this garbage in my text
/do you know maybe some good tutorial with examples on how to use good Ragex syntax?
-
Jun 28th, 2011, 04:24 PM
#4
Re: Help newbie with Ragex (easy)
Sorry, I guess I didn't press > hard enough fixed now.
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
|