Extract string from file based on multiple patterns in a file

I have multiple formats in which the required string can come in a column of csv file . Formats are like :

 NOTPROVIDED 3392076122/RFB/2006270519020060      3392076122 4031253506 RAMIN ABD ULJABAR AF/RFB/202006     NOTPROVIDED 3392076122 EASTERN U/RFB/200627 

Any of the above formats can appear in the file and I need to extract "3392076122" from all above patterns and the formats are dynamic and will keep on changing. Instead of using modifying java code each time and using substring etc i am looking for a solution which can be updated dynamically on the fly using some template engine like FTL,Thymeleaf . How can this be achieved ?

If not with template engine kindly suggest the regex for extracting from above formats.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.