synhershko
08/18/2023, 1:02 PM[^\\]\\\"
but I can't seem to make it compile and used from a Regex class - what am I missing? attached is an IntelliJ screenshot. I honestly tried all possible escapings. IDE and compiler complain about "redundant escape character". The regex as typed in this question is 100% correct and fully testedJoffrey
08/18/2023, 1:04 PM\
escapingJoffrey
08/18/2023, 1:07 PMSam
08/18/2023, 1:07 PMsynhershko
08/18/2023, 1:08 PM"""
works but now still some escaping hell with the slashes, I'll figure it out from here, thanks!Sam
08/18/2023, 1:08 PM"
does not need to be escaped in a regular expression (although it does in a Kotlin string)synhershko
08/18/2023, 1:15 PMJoffrey
08/18/2023, 1:16 PMRegex("""[^\\]\\"""")
should work (it's a bit hard to digest that there are 4 double-quotes at the end (1 for your regex, and 3 for the closing raw string 😆)mcampbell
08/21/2023, 5:05 PMJoffrey
08/21/2023, 5:06 PMmcampbell
08/21/2023, 5:06 PMJoffrey
08/21/2023, 5:07 PM