Is there a way in Kotlin to match a string but not...
# announcements
k
Is there a way in Kotlin to match a string but not within the quotes
Copy code
"
or comments ? I need it as utility that searches for a text or pattern in kt files but not if it is inside string literal or comments.
d
You probably need a full-blown parser to do this properly. Check out https://github.com/kotlinx/ast
👍 1
k
Is there a way with regex?
d
Probably maybe? But its definitely the wrong tool for the job.
💯 1
m