This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
@bdelarosa I would actually recommend a slightly more flexible expression for this. While the express '[0-9]+oz' @Lwt08 presented does get the job done for most strings it doesn't take into consideration variances in capitalization or fractional ounces. As such it would return '16oz' per the provided example, but will not return 23.5oz or 16Oz as per some examples from your sample data. As such I would recommend a more robust expression that takes these additional patterns into account. The following expression more accurately describes the possible patterns based on your sample data.
This expression can be used directly in the Regex tool in Designer with the parse option to achieve your desired result. The important part is the logical group '[0-9\.]+[Oo][Zz]' contained within the parenthesis. This expression looks to match/parse one or more digits with or without a decimal place after a white space character and immediately followed by the letters 'oz' in any form of upper or lower case. The parts outside of the parenthesis just generically match the rest of the string from the beginning to the end.