Created
November 6, 2017 22:24
-
-
Save MrTarantula/9422afa1fcaa75a76886cefedd84bb18 to your computer and use it in GitHub Desktop.
Duplicate files in .*proj files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var proj = ``; | |
const pattern = /\s*<Content Include="(.*)" \/>/; | |
const testing = proj.split("\n"); | |
const matches = []; | |
testing.forEach((str) => { | |
if (str.match(pattern)) { | |
if (matches.find((match) => match === str)) { | |
console.log("Duplicate found: " + str); | |
} | |
matches.push(str); | |
} | |
}); | |
console.log(matches.length === 0 ? "No matches found" : "Finished searching"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment