Morrowind

File information

Last updated

Original upload

Created by

Daemonjax

Uploaded by

Daemonjax

Virus scan

Safe to use

1 comment

  1. Daemonjax
    Daemonjax
    • supporter
    • 66 kudos
    Source code:


    import java.io.IOException;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;

    public class ListAllTextures
    {
    public static void main (String[] args) throws IOException
    {
    if (args.length != 2) System.exit(1);

    final String extension = "." + args[0];
    final String filename= args[1];
    final Pattern pattern = Pattern.compile("[a-zA-Z_0-9]+" + extension);
    final Matcher matcher = pattern.matcher(readFile(filename));

    while (matcher.find()) System.out.println(matcher.group());
    }

    static String readFile(String filename) throws IOException
    {
    String result = new String(Files.readAllBytes(Paths.get(filename)));
    return result;
    }
    }