regex help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,

i need a regular expression which would match the exact word in a given
string.
for ex

my input is as below and my pattern is .ocx
".docx .DOCM .DOTX .DOTM"

i want only .ocx string to be matched, if any..

currently, it matches docx also....which i dont want...

what is the appripriate regex pattern..

do help out
 
dot (.) matches everything, so use "[.]ocx" instead of of ".ocx" (variants:
"\\.ocx" or @"\.ocx").

/LM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Regex in C# 4
Regular Expression 1
Simple regex question! 2
Regex doubt 9
regex pattern 2
Regex Woes 2
Regex search: advanced search range settings? 3
Match Blank Characters outside Multiline Comments 1

Back
Top