-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegexGenerator.java
More file actions
22 lines (18 loc) · 869 Bytes
/
Copy pathRegexGenerator.java
File metadata and controls
22 lines (18 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import generator.RegEx;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class RegexGenerator {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter RegEx:");
RegEx regex = new RegEx(bf.readLine());
if(regex.isValid()) {
String generatedString = regex.generateRandomString();
System.out.println("Generated Random String:\n" +
generatedString);
} else System.out.println("Please enter a valid RegEx! " +
"Read this article for more information about RegEx about available RegEx operations:\n" +
"http://www.categories.acsl.org/wiki/index.php?title=FSAs_and_Regular_Expressions");
}
}