asp.net - Is it possible to turn off case insensitivity using pattern only? -


regex has set option ignorecase. possible turn off case insensitivity using pattern (like negation of (?i))?

in example below, find pattern result "abaaabbaab".

string pattern = "???"; string input = "aaaaaaaaaa"; var regex = new regex(pattern, regexoptions.ignorecase); var result = regex.replace(input, "b"); 

you can turn off options inline using - before option. e.g. negation of (?i) (?-i):

a minus sign (-) before option or set of options turns options off. example, (?i-mn) turns case-insensitive matching (i) on, turns multiline mode (m) off, , turns unnamed group captures (n) off.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -