Click here to Skip to main content
13,453,957 members (45,896 online)
Rate this:
Please Sign up or sign in to vote.
i have a document in which i have to find word "Foto" in between the "<" and ">" tags. i used this regex

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 this..

<hello world Foto:abc> ..... Find ok
<hello "world Foto:abc>.....Find fail
Posted 24-Feb-13 20:21pm
Updated 24-Feb-13 20:23pm
Rate this: bad
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,
Rate this: bad
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[^]

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03-2016 | 2.8.180321.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2018
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