N
Natalia DeBow
Hi,
I am stuck trying to come up with a regular expression for the following
pattern:
A string that contains "/*" but that does not contain */ within it.
Basically I am searching for C-style multiline comments and would much
rather use Regex than strings.
Here is what I have, but it does not seem to work.
Match match = Regex.Match(textLine, @"\s*(/[*])(?<comment>(?![*]/).*)$");
There is something wrong with the fact that the match should succeed only if
the string "*/" is not found.
Any input would be greatly appreciated!
Thanks,
Natalia
I am stuck trying to come up with a regular expression for the following
pattern:
A string that contains "/*" but that does not contain */ within it.
Basically I am searching for C-style multiline comments and would much
rather use Regex than strings.
Here is what I have, but it does not seem to work.
Match match = Regex.Match(textLine, @"\s*(/[*])(?<comment>(?![*]/).*)$");
There is something wrong with the fact that the match should succeed only if
the string "*/" is not found.
Any input would be greatly appreciated!
Thanks,
Natalia