Hi,
I'm using c# RegEx to search quoted strings in a script text.
I use this expression : new Regex("\"((?:\\\\.|[^\\\\\"]*)*)\"")
,
e.g "((?:\\.|[^\\\"]*)*)"
meanings to not take care of \"
cases
This makes RegEx.Matches
runs and never stops for some input strings.
Never mind this problem with .Net RegEx, I know my expression is not the best one.
Before, I used (?<!\\)".*?(?<!\\)"
expression but it is not enough for "\\"
input string.
The aim is to detect quoted strings before I analyze script codes.
Any one would suggest a good expression ?
It has to work for :
echo("Hello" + yourName + ", here is \"MyTest\"");
path = "\\" + file;
echo("path ends with \\");
(beware, \ are strangely edited with this site)
Thanks a lot.