Just a suggestion, would these usage be more intuiative to the user (using full regular expression pattern for matches)?
Use URL query parameter:
<root>file:///opt/lib?file-re-pattern=.*jar</root>
Or extend root element with attribute:
<root file-re-pattern=".*jar">file:///opt/lib</root>