Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Could anyone please tell me the meaning of this Regular Expression?
Regex regex = new Regex("\\<[^\\>]*\\>");
Posted
Updated 4-Jan-11 22:21pm
v2

Regex regex = new Regex("\\<[^\\>]*\\>"); .

can be rewritten as
Regex regex = new Regex(@"\<[^\>]*\>"); .


Match must start with a '<' character, then zero or more characters excluding '>' and then a '>' character

Regards
Espen Harlinn
 
Share this answer
 
Comments
Espen Harlinn 5-Jan-11 4:42am    
Oddly enough somebody voted me a 1 for this - it's essentially the same info provided by Hiren Solanki in his tip at http://www.codeproject.com/Tips/136704/Remove-all-the-HTML-tags-and-display-a-plain-text-.aspx

There where 0 answers to this question when I started to write my answer, and it isn't all that unusual that several people answers the same question at the same time. Ahh .. well, go figure ..
OriginalGriff 6-Jan-11 6:28am    
No, I suspect it's the OP not liking the answer too much...compensation applied!
Espen Harlinn 6-Jan-11 6:43am    
Thanks :-)
See my TIP[^] Here, I've explained the same expression there.

It's just used to find any HTML tag.
 
Share this answer
 
v2
Comments
Rajesh Anuhya 5-Jan-11 4:20am    
Good one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900