c# - Regex pattern causes compilation error -


in c# have regex pattern:

r = new regex("^(("(?:[^"]|"")*"|[^,]*)(,("(?:[^"]|"")*"|[^,]*))*)$"); 

at moment giving me error: "cs1002: ; expected"

i understand escape string problem, can't see is.

cheers help!

how ahmed kraiem told you need escape " \

your version:

r = new regex("^(("(?:[^"]|"")*"|[^,]*)(,("(?:[^"]|"")*"|[^,]*))*)$"); 

my version

r = new regex("^((\"(?:[^\"]|\"\")*\"|[^,]*)(,(\"(?:[^\"]|\"\")*\"|[^,]*))*)$"); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -