Filter values from list using multiple patters


I receiving following list form external data resource:

my_list = [

Which elements are dynamic and cannot be predicted. So I’m need to exclude all elements which consist two patterns like dev-* and test-* to receive:

my_list = [

Could you please advice how to achieve this?

Use a for expression with a filtering clause:

Use the startswith or regexall function to as part of the filtering clause you write:,