Split string data on a string match
问题 I'm working with some xml and I'd like to clean it up before I parse it. What i'd like to do specifically, is take the data (example below) and match it on the string " <data> " and then trim everything before it leaving the node in tact. Then I would match on the string " </data> " and truncate everything after it, once again leaving the matched node in tact. Turning this: <dwml> <head> <child></child> </head> <data> <child></child> <child></child> </data> <more></more> </dwml> into this: