There are several ways to do this, but you can do:
String str = "completei4e10";
str = str.replaceAll("completei(\\d+)e.*", "$1");
System.out.println(str); // 4
Or maybe the pattern is [^i]*i([^e]*)e.*, depending on what can be around the i and e.
System.out.println(
"here comes the i%@#$%@$#e there you go i000e"
.replaceAll("[^i]*i([^e]*)e.*", "$1")
);
// %@#$%@$#
The […] is a character class. Something like [aeiou] matches one of any of the lowercase vowels. [^…] is a negated character class. [^aeiou] matches one of anything but the lowercase vowels.
The (…) is a capturing group. The * and + are repetition specifier in this context.