java - Need a regex to extract a substring -


i struggling figure out decent way extract substring below string.

inputs:   invoice 1800000173 of 06/18/2014/150 usd discnt 07/02/2014  invoice 1200000000 of 02.04.2014/150 details 

the above 2 possible combinations.

expected output:  invoice 1800000173 of 06/18/2014  invoice 1200000000 of 02.04.2014 

there similar question asked here - regex date string didn't me here. suggestions ?

"invoice (\d+) of (\d\d[./]\d\d[./]\d{4})" 

two capturing groups, first of 1 or more digit invoice number, second date portion. escaping backslashes need done appropriately.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -