Regex Pattern Help

Scottintexas

Well-known member
Joined
Jun 21, 2018
Messages
47
Location
Texas
Programming Experience
5-10
Text = ";SomeTrash (um);SomeTrash Too (N);SomeTrash Again (mm);SomeTrash Too (J);SomeTrash Too (J/cm^3)"

Pattern I have tried = (?<=\()(\w*\/?\w*\^\d*)(?=\)) This is getting the last unit, J/cm^3, only.

This pattern, (?<=\()(\w*\/?\w*)(?=\)), gets all but the last unit.

How do I combine them? There are single and double spaces between each of the items, so that is why I am using the () to find the characters of interest.

Thanks
 
How about this?
(?!\()[^()]+(?=\))
 
Back
Top Bottom