I am having the following line of strings
from the above string I want to pick only OPX value, I will be having dyanmic values during each refresh, so the line to have OPX value, how can I pick that value alone?
1—> NAT_NAT_HYU_MOB_DSP_LOY_RET_P2+++_PGD_Autotrader_ATC-HYU-MOB-RET-Used/CPO-SRP-Mobile-320x50_320x50_None_DFV_NON_N_Learn More_N_NON
2----> NAT_NAT_HYU_MOB_DSP_LOY_RET_P2+++Autotrader_ATC-HYU-MOB-RET-Used/CPO-SRP-Mobile-320x50_320x50**PMP**DFV_NON_N_Learn More_N_NON
Now, in this above two lines I want to get the word next to PGD and PMP, so in the above example i want to get the values as Autotrader for the lone 1 and DFV for the line 2. How can i get?
May I have some more clarifications, like what value(s) are you wanting to fetch?
Thanks & Regards,
@monish06 Will the Underscores be there always in it?
From this string
1-----> NAT_NAT_ELA_MOB_DSP_LOY_RET_P2+++_NON_Autotrader_ATC-ELA-MOB-RET-Used/CPO-SRP-Mobile-320x50_320x50_OPX_DFV_NON_N_Learn More_N_NON
I want to check if the line contains “OPX”
2—> NAT_NAT_HYU_MOB_DSP_LOY_RET_P2+++_PGD_Autotrader_ATC-HYU-MOB-RET-Used/CPO-SRP-Mobile-320x50_320x50_None_DFV_NON_N_Learn More_N_NON
From the 2nd line of string I want to get the words next to the word of “PGD” so, in this line I want to get the word “Autorader”.
3----> NAT_NAT_HYU_MOB_DSP_LOY_RET_P2+++Autotrader_ATC-HYU-MOB-RET-Used/CPO-SRP-Mobile-320x50_320x50_PMP_DFV_NON_N_Learn More_N_NON
From the 3rd line of string I want to get the words next to the word of “PMP” so, in this line I want to get the word “DFV”.
Note: these string will change dynamically.
@monish06 What is meant by Dynamic Change?
Please try to use Regex patterns something like:
and see if that helps
For checking OPX is there or not, please use the below syntax -
For getting the next word after PGD, please use the below Regex Syntax -
For getting the next word after PMP, please use the below Regex Syntax -
If you want to fetch the word after PGD or PMP dynamically then, please use the below syntax -
Thanks & Regards,
Thank you for the solution @apurba2samanta
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.