1 2 3 4 5 6 7 8 9 10 11 12
| public static final String regex = "bb((..)*?)0d0a"; Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); Observable.create((ObservableEmitter<String> emitter) -> { String hexString = "BB9716A33000112233445566778899001122FD6F030000010055740D0ABB9716A33000112233445566778899001122FD6F030000010055740D0A"; Matcher mMatcher = pattern.matcher(hexString); while (mMatcher.find()) { String hexString = mMatcher.group(); emitter.onNext(hexString); } emitter.onComplete(); })
|