regex help

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
 
L

Luc E. Mistiaen

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

Top