Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
hi
i have a document in which i have to find word "Foto" in between the "<" and ">" tags. i used this regex
C#
"<(?:\w*)?Foto(?:\w*)?>"

this is working fine if there is a string with only alphabetic words in between the tags, but is there is any speacial character then it fails to find.like this..

<hello world Foto:abc> ..... Find ok
<hello "world Foto:abc>.....Find fail
Posted
Updated 24-Feb-13 20:23pm
v2

Hello Choudhary,


\w in regex means: any word character (letter, number, underscore)
you may use . (dot) that means: any single character

Good luck,
Edo
 
Share this answer
 
Choudhary has a good answer. To help you further check out some of these sites. A very helpful site is regexlib[^]; they have a large library of Regular Expressions. They also have a RegEx tester[^]. Also a very useful RegEx tool is available here[^]
 
Share this answer
 

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