Skip to content

Instantly share code, notes, and snippets.

@funsunz
Created May 4, 2016 03:45
Show Gist options
  • Save funsunz/4e639c6606cc72a6a6bdb591dd8f7c77 to your computer and use it in GitHub Desktop.
Save funsunz/4e639c6606cc72a6a6bdb591dd8f7c77 to your computer and use it in GitHub Desktop.
String s = "encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp0wHYbg/NOPO3nzMD3dndwS0MccuMeXCHgVlGOoYyFwLdS24Im2e7YyhB0wrUsyYf0/nhzCzBK8ZC9eCWqd0aHbdgOQT6CuFQBMjbyGYvlVYU2ZP7kG9Ft6YV6oc9ambuO7nPZh+bvXH0zDKfi02prknrScAKC0XhadTHT3Al0QIDAQAB');\n\nheaders: {"
+"\n'VerificationToken': 'T1g_69b6CqBB1C0kO7XBYp_H_eVCUjnCU6GB7o3lx7VHCpSgKncivkOQuKPAxR2czgCxBb1ctnA2uK-GsIYijNH_F5Y1:Xn2ZkeeD-Ythul_Y6GxHrOcuW7bLwrUQxwf23E9hNVDPVQupoTzIdyvSch-z2-f3Ay1m8yRiISslUetKVMi3ExT1t3k1'"
+"\n},";
Matcher m = Pattern.compile("encrypt\\.setPublicKey\\('([^']+)'.*.*VerificationToken':'([^']+)'").matcher(s.replaceAll("\\s+", ""));
if (m.find()){
String publicKey = m.group(1);
String VerificationToken = m.group(2);
System.out.println(publicKey);
System.out.println(VerificationToken);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment