


Note that the substring function returns the Group 1 value here: You can match c in Commit in a case insensitive way using and make sure you match a _ before Commit and use substring(col_name from 'comments:(.*?)(_ommit|$)') Is there a way to limit the selection, such that it returns words only before Commit (wherever Commit exists) or till the end of line. I have tried the following pattern, but unfortunately it returns everything after Commit So the extracted column should look like: February_2021_FFRPrice_RegModelsOnly_Demand Sales Volume*CSOPpriceĬhina_market_CSOP_Demand Sales Volume_PFJan2021įunctional_test_2_Cores_FWD_facing_regressor_leak_fix (Also note that Commit can also be of lowercase as in commit) The words I am trying to extract starts from comments: and are before Commit_c596a521e07 if the Commit word exists or it's till the end of line. Subset:|actuals_source:|comments:china_market_CSOP_Demand Sales Volume_PFJan2021 subset:|actuals_source:|comments:February_2021_FFRPrice_RegModelsOnly_Demand Sales Volume*CSOPprice_Commit_a57f193aede I have the following rows (sample) in my postgresql from which I am trying to extracts words.
