Orbit
Orbit is a Java 21 regex and lexical transducer library that provides:
- Linear-time guarantees — ReDoS-proof execution via DFA and PikeVM engines
- Drop-in
java.util.regexcompatibility —Pattern,Matcher,MatchResultAPIs - Full Unicode support — properties, case folding, POSIX classes
- Lexical transducer API — compose, invert, and apply finite-state transducers
- Multiple execution engines — lazy DFA, PikeVM, bounded backtracker, selected automatically
Quick start
import com.orbit.api.Pattern;
import com.orbit.api.Matcher;
Pattern p = Pattern.compile("(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})");
Matcher m = p.matcher("Today is 2025-01-15.");
if (m.find()) {
System.out.println(m.group("year")); // 2025
}
Documentation
- Introduction — motivation and design goals
- User Guide — patterns, flags, and the
MatcherAPI - API Reference — complete API surface
- Configuration — flags, engine hints, and tuning
- Compatibility — JDK, Perl, .NET, and RE2 compatibility
- Transducer Guide — lexical transducer API
- Security Guide — ReDoS protection and safe usage
- Performance Guide — engine selection and benchmarks
- Migration Guide — migrating from
java.util.regex