Skip to content

Commit

Permalink
fix: enhance regex for DD and 5.1/7.1 combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
Viren070 committed Jan 19, 2025
1 parent 8baca91 commit c1b9632
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/parser/src/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ export const PARSE_REGEX = {
audioTags: {
Atmos: /(?<![^ [(_\-.])(atmos)(?=[ \)\]_.-]|$)/i,
'DD+':
/(?<![^ [(_\-.])((?:ddp|dolby[ .\-_]?digital[ .\-_]?plus)(?:[ .\-_]?(5\.1|7\.1))?)(?=[ \)\]_.-]|$)/i,
DD: /(?<![^ [(_\-.])((?:dd|dolby[ .\-_]?digital)(?:[ .\-_]?(5\.1|7\.1))?)(?=[ \)\]_.-]|$)/i,
/(?<![^ [(_\-.])((?:d(olby)?[ .\-_]?d(igital)?[ .\-_]?(p(lus)?|\+))(?:[ .\-_]?(5[ .\-_]?1|7[ .\-_]?1))?)(?=[ \)\]_.-]|$)/i,
DD: /(?<![^ [(_\-.])((?:d(olby)?[ .\-_]?d(igital)?)(?:[ .\-_]?(5[ .\-_]?1|7[ .\-_]?1))?)(?=[ \)\]_.-]|$)/i,
'DTS-HD MA': /(?<![^ [(_\-.])(dts[ .\-_]?hd[ .\-_]?ma)(?=[ \)\]_.-]|$)/i,
'DTS-HD': /(?<![^ [(_\-.])(dts[ .\-_]?hd)(?![ .\-_]?ma)(?=[ \)\]_.-]|$)/i,
DTS: /(?<![^ [(_\-.])(dts(?![ .\-_]?hd[ .\-_]?ma|[ .\-_]?hd))(?=[ \)\]_.-]|$)/i,
TrueHD: /(?<![^ [(_\-.])(true[ .\-_]?hd)(?=[ \)\]_.-]|$)/i,
5.1: /(?<![^ [(_\-.])((?:ddp|dd)?[ .\-_]?5[ .\-_]?1)(?=[ \)\]_.-]|$)/i,
7.1: /(?<![^ [(_\-.])((?:ddp|dd)?[ .\-_]?7[ .\-_]?1)(?=[ \)\]_.-]|$)/i,
5.1: /(?<![^ [(_\-.])((?:d(olby)?[ .\-_]?d(igital)?[ .\-_]?(p(lus)?|\+)?)?[ .\-_]?5[ .\-_]?1)(?=[ \)\]_.-]|$)/i,
7.1: /(?<![^ [(_\-.])((?:d(olby)?[ .\-_]?d(igital)?[ .\-_]?(p(lus)?|\+)?)?[ .\-_]?7[ .\-_]?1)(?=[ \)\]_.-]|$)/i,
AC3: /(?<![^ [(_\-.])(ac[ .\-_]?3)(?=[ \)\]_.-]|$)/i,
AAC: /(?<![^ [(_\-.])(aac)(?=[ \)\]_.-]|$)/i,
},
Expand Down

0 comments on commit c1b9632

Please sign in to comment.