Extracting a part of string in java
<p><strong>I am having the following data in a text file:</strong></p>

<pre><code> proc sort data=oneplan.cust_duplicates(dbindex=yes) out=mibatch.cust_duplicates;
    from oneplan.fsa_authorised_agencies (dbindex=yes) 
    set oneplan.fsa_agency_permissions(where=(regulated_activity in ('103','106','107','108')));
    set oneplan.customer_flags(where=(flag_id in(54,14,34)));
    from oneplan.document_history (dbindex=yes) 
    set oneplan.product_references;
  proc sort data=oneplan.fast_track_log(where=(upcase(business_entry)="INCOME VERIFICATION FAST TRACKED"))   out=fast_track_log;
    set oneplan.product_characteristics(rename=(value=filler)where=(characteristic_type="OFFS" ));
    set oneplan.mtg_offset_benefits (where=(modified_date between &amp;extractdate and &amp;batchcutoff) 
      from oneplan.mtg_payment_options a;
    from oneplan.acc_retention_risk acr;
    from oneplan.acc_retention_risk_hist acr;
    from oneplan.account_repay_veh rv;
    from oneplan.repay_vehicle_map rvm;
    from oneplan.frozen_accounts as fa left join mibatch.accounts as a
</code></pre>

<p>Now i need to fetch the part from each line which starts with <code>oneplan.</code> and ends with a space. </p>

<p>Also if the line has two <code>oneplan.</code> then each must be extracted separately.</p>

<p>Example:  <code>agtut oneplan.m htyutu oneplan.j hgyut</code></p>

<p>i need the output as: <code>oneplan.m</code> and <code>oneplan.j</code></p>

<p>kindly give me suggestions in doing this please...</p>
