Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package regex;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- public class Regex {
- public static void main(String[] args) {
- String s = "HP: 648/648 CP: 654/657 ADRENALINE: 105 ENDORPHINE: 0 BERSERK: 10 None: 0% ";
- Pattern p = Pattern.compile("^HP:\\b(\\d+)");
- Matcher m = p.matcher(s);
- boolean foo = m.find();
- //String go = m.group(0);
- String g1 = m.group();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment