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" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -