weimingfei
6 小时以前 9ccd59974993aa9914daf045aa6f2bbb5152047c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.doumee.ticketmachine;
 
import com.doumee.keyCabinet.utils.i485.SportUtils;
 
import org.junit.Test;
 
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
import static com.doumee.keyCabinet.utils.i485.SportUtils.hexToBinary;
 
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() {
        String s = "Result:12.00mg/100ml";
        Pattern pattern = Pattern.compile("([0-9]+\\.[0-9]+)");
        Matcher matcher = pattern.matcher(s);
        if (matcher.find()) {
            System.out.println(matcher.group(1)); // 输出: 12.00
        }
    }
 
 
 
}