Skip to content

Instantly share code, notes, and snippets.

Bauepete /
Created Apr 8, 2019
RegEx handling in Java and the most important RegEx Patterns
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) {
System.out.println("RegEx Demo");
// The general java approach: Pattern, Matcher
Pattern p = Pattern.compile("b(a|e)uer");
Matcher m = p.matcher("bauer beuer");
Bauepete /
Created Apr 12, 2019
Files.write usage.
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
public class FileWriter {
public static void main(String[] args) throws IOException {
System.out.println("File Write Collection");
String[] fileContent = {