@@ -0,0 +1,719 @@
+package com.lhg.test.regularexpression;%0A%0Aimport java.util.Scanner;%0A%0Apublic class WeixinHao %7B%0A%0A    //%E5%BE%AE%E4%BF%A1%E5%8F%B7%E4%BB%85%E6%94%AF%E6%8C%816-20%E4%B8%AA%E5%AD%97%E6%AF%8D%EF%BC%8C%E6%95%B0%E5%AD%97%EF%BC%8C%E4%B8%8B%E5%88%92%E7%BA%BF%E6%88%96%E5%87%8F%E5%8F%B7%EF%BC%8C%E4%BB%A5%E5%AD%97%E6%AF%8D%E5%BC%80%E5%A4%B4%0A    public static void main(String%5B%5D args) %7B%0A        String pattern = %22%5E%5Ba-zA-Z%5D%7B1%7D(%5C%5Cw%7C-%7C_)%7B5,19%7D$%22;%0A%0A        while(true) %7B%0A            Scanner input=new Scanner(System.in);%0A            String result = input.next();%0A            int length = result.length();%0A            if (length %3E 20) %7B%0A                System.out.println(%22too long%22);%0A            %7D else %7B%0A                System.out.println(%22result:%22 + result.matches(pattern));%0A                if(result.equals(%22exit%22)) %7B%0A                    System.exit(0);%0A                    break;%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

regular expression