Hi,

Suppose I have a below string

*TAG_A* TAGAValue
*TAG_B* TAGBValue
*TAG_C* TAGCValue
*TAG_D* TAGDValue

Now, I want to check if above string contains TAGCValue. If yes then I want to get its param name i.e TAG_C which is enclosed between *. How we can achieve this using Regex?


Thanks
Raj

--- Update ---

Also, another requirement is as below.

If I have a string as

*ABCD*EFGH*IJKL*MNOP

And I want to check
if above string contains 'FG' then get 'EFGH' which is enclosed in between *s.
if above string contains 'MN' then get 'MNOP'. Be careful, here there is no * at the end

Please help with this also.


Thanks
Raj