-1

I need to use regex to match a string that contains ALL 3 of the following:

2160
ATVP
DV

The following should MATCH:

Title.2160p.ATVP.WEB.DV.x265-Rls
Title.2160p.DV.WEB.ATVP.x265-Rls
Title.ATVP.2160p.WEB.DV.x265-Rls

The following should NOT match:

Title.1080p.WEB.ATVP.x265-Rls
Title.2160p.WEB.DV.x265-Rls
Title.2160p.BluRay.x265-Rls

This is what I tried but it matches everything that contains atleast one of the strings:

(ATVP|2160|DV).*

This is where I'm testing these regex queries: https://regex101.com/r/vCSPqZ/1.

I'm still new to working with regex so I'm kind of lost here. This should be relatively simple for someone who knows what they're doing. Any help appreciated. Thanks guys

Edit: Thanks for the other links. I figured it out. Thanks guys

Solution:

(?=.*2160)(?=.*ATVP)(?=.*DV).*

https://regex101.com/r/vCSPqZ/2

Riley Bell
  • 375
  • 2
  • 10

0 Answers0