c# how to write a dot modifier in RegExp? -


private string pattern = @"^.$"; 

the dot not identified modifier, literal string, how idetify modifier?

you forgot add quantifier .:

if want match 0 or more: @"^.*$"

if want match 1 or more: @"^.+$"

don't forget regular expressions greedy default. if want non-greedy, append ? .*


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -