Compare commits

...

2 Commits

Author SHA1 Message Date
chteufleur 5050760b4e Add Android command shell 2015-10-02 14:24:49 +02:00
chteufleur 4a86bee82a Add extract from Regex (Java) 2015-10-02 14:22:05 +02:00
2 changed files with 19 additions and 0 deletions

7
Android/installAPK.pl Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Installation/Mise a jour d'un apk
pm install -r /mnt/sdcard/MyApp.apk
# Lancement d'une appli
am start -n fr.my.app/.LaunchActivity

View File

@ -5,3 +5,15 @@
public static boolean isIp(String ip) {
return ip != null && !ip.equals("") && ip.matches("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
}
public static void extractFromRegex(String str) {
Pattern pattern = Pattern.compile(".*@(.*)");
Matcher matcher = pattern.matcher(str);
while (matcher.find()) {
if (matcher.groupCount() == 1) {
System.out.println("domaine: "+matcher.group(1));
}
}
}