I have a dynamic value for correlation, but boundaries are dynamic and lengths of boundaries also changing.
Please provide the sollution with example.
The only general solution is to get the complete message and do it your self. Any context that can be used will like make the solution like feasible and more simple. So when you can describe a pattern you observe or give a few examples. E.g. can variable boundaries determined from previous requests etc.
The most flexible method for implementation will be web_reg_save_param_regexp().