Regex Pattern Help

Scottintexas

Member
Joined
Jun 21, 2018
Messages
18
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
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
5,698
Location
Chesapeake, VA
Programming Experience
10+
How about this?
(?!\()[^()]+(?=\))
 
Top Bottom