For a assignment I need to extract certain information from files (in java), the text in the files goes similar to this :
OFFICE_MANAGEMENT = Higher ManagementCONSTRUCTION = SupervisorCONTRACT_MANAGEMENT = Contract ManagerPROJECT = Project ManagerLOCATION = User Specified LocationDEPARTMENT = Local.........
I need to extract each of the specific items
I have little or no experience with in regex but I tried.
If I use something like
OFFICE_MANAGEMENT =\s*([a-z A-Z]*)\s*
I get
Higher ManagementCONSTRUCTION
as result. I may not alter the text 🙁
How can I make sure he takes everyting until the next item. I was thinking that he needs to read everything until the next word with more then one Captital letter but I have no idea how to do this.
So any help or suggestions will be more then welcome
Assuming that the keys are all-uppercase (plus possibly underscores):
separates your string into
(and for each match,
regexMatcher.group(1)contains the title andregexMatcher.group(2)contains the description.)