Click here to Skip to main content
11,410,379 members (61,285 online)
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 21:21pm
Edited 24-Feb-13 21: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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 159
1 Maciej Los 68
2 Philippe Mori 60
3 BillWoodruff 60
4 OriginalGriff 60
0 Sergey Alexandrovich Kryukov 8,755
1 OriginalGriff 6,915
2 Maciej Los 3,390
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2015
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