I need to match ["this", but not:["this"
["this"
:["this"
I have this code:
Match match = Regex.Match(result, @"\[""(.*?)""", RegexOptions.IgnoreCase); while (match.Success) { MessageBox.Show(match.Groups[1].Value.Trim()); }
I tried the template @"(?!:)\[""(.*?)""", but it still matches :["this". What picture do I need for this?
@"(?!:)\[""(.*?)"""
You look ahead (to the right of the line) when you want to look (to the left of the line).
Give it a try @"(?<!:)\[""(.*?)""".
@"(?<!:)\[""(.*?)"""
I used RegexBuddy (I love this application) installed in .NET and got the following expression:
You make a negative look when you have to do a negative lookbehind. Try instead:
Match match = Regex.Match(result, @"(?<!:)\[""(.*?)""", RegexOptions.IgnoreCase);
Source: https://habr.com/ru/post/1793924/More articles:How to extract only stored procedures from metadata? - entity-frameworkInstall php mongodb driver on mediatemple dv 4.0 - mongodbFlash Builder 4 Security Access Error Destination URL: DefaultHTTP - securityMemcache limit of 1 MB in Google App Engine - google-app-engineC # ref / out options against laziness - c #django url reverse does not work for named URLs (reissued) found the reason, but now stuck! - djangobring JInternalFrame to the forefront - javafwrite puts an error indicator into a stream in C - cHow to set report language in report builder 3.0? - reporting-servicesIs there an available online architecture for e-commerce in java - javaAll Articles