Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
hi
 
i have a document in which i have to find word "Foto" in between the "<" and ">" tags. i used this regex
"<(?:\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 24-Feb-13 20:21pm
Edited 24-Feb-13 20:23pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello Choudhary,
 

\w in regex means: any word character (letter, number, underscore)
you may use . (dot) that means: any single character
 
Good luck,
Edo
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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[^]
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100