Given that an input String may be specified as follows:
- read(xpath(‘…’)) or
- xpath(‘…’) or
- …
Where … just holds some xpath expression, for example,/comment/text
All I really want is the xpath expression; what would be an efficient way to in general extract this value given the three possible valid patterns that could be specified.
Also, I am implementing this in Java.
Here is the basic example, it matches xpath part in both of your string examples: