// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.regex.*;

public class ValParse {
    private static final Pattern p = Pattern.compile("(?:.*?)(?:a[ ]*=[ ]*)([0-9]+)(?:.*?)(?:b[ ]*=[ ]*)([0-9]+)(?:.*?)(?:c[ ]*=[ ]*)([0-9]+)");
    public static void parse(String s) {
        Matcher m = p.matcher(s);
        while (m.find()) {
            String a = m.group(1);
            String b = m.group(2);
            String c = m.group(3);
            System.out.println(a + " " + b + " " + c);
        }
    }
    public static void main(String[] args) {
        parse("a=1 b=2 c=3");
        parse("bla a = 4 bla b = 5 bla c = 6 bla");
    }
}
