[Solved] Java int to fraction
Try (?<=-| |^)(\d+)(?!\d*\/) Explanation: (?<=…) – positive lookahead, assert, what precedes matches pattern inside -| |^ – match either -, , or beginning of a line ^ (\d+) – match one or more digits and store in first capturing group (?!\d*\/) – negative lookahead, assert what follows is not zero or mroe digits followed by … Read more