Affects Version/s: None
Fix Version/s: None
This is a proposal to open up read-only access to the internal state of RegExp objects.
The RegExp parser provides a useful parsed object model for regular expressions. Today it offers three rendering functions:
1) To Automaton (for query execution)
2) To string (for machine-readable regular expressions)
3) To StringTree (for debug purposes)
There are at least 2 other rendering functions that would be useful:
a) To "Explain" format (like the plain-English descriptions used in regex debugging tools)
b) To Query (queries used to accelerate regex searches by providing an approximation of the search terms and hitting an ngram index)
To support these and other renderings/transformations it would be useful to open read-only access to the fields held in RegExp objects - either through making them public finals or offering getter access methods. This would free the RegExp class from having to support all possible transformations.