This method allows you to extract the text that exists between the first occurrence of from and to . It can be used with a single parameter, then to becomes from . There is also a third optional parameter - occurrence which defines which occurrence should be taken into account (default: the first occurrence of from and to ).