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
 
Back
Top