c# - Regex returning only portion of a string -


i have following regex string:

(@model.[a-z]*) 

i'm trying use pull values razor view email. have following values:

  • @model.firstname
  • @model.company

i expect following code return these values in list:

regex.matches(emailstring, "@model.[a-z]*").cast<match>().select(match => match.value) 

instead list of same value "@model." missing here?

the values can contain both lowercase , uppercase, therefore regexp should be:

(@model\.[a-za-z]*) 

... or can put regexoptions.ignorecase option apply model part.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -