Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.regex.Pattern;
- public class RegexThread extends Thread{
- private Pattern p;
- RegexThread(){
- /* Create a new, second thread */
- super("Regex Thread");
- this.p = Pattern.compile("a*b");
- start();
- }
- /* Thread compiles regex string to do stress CPU. */
- public void run(){
- while(true){
- p = Pattern.compile("a*b");
- }
- }
- }
Add Comment
Please, Sign In to add comment