I have the following input:
_YUE_ENSUB_L9939486_16X9
And I would like to match on YUE and EN. The conditions are:
- Between two
_, it only allows[A-Z419]. - It should not include the suffix
SUB,SUBS, orFN.
So far I have:
([A-Z419]+)(?:SUB|FN|SUBS)?
Or:
[A-Z419]{2,5}(?=SUB)
But both fall a bit short. What would be the correct regex for this? I suppose something like this perhaps but it seems a bit overkill and probably not a great match:
[A-Z419]+(?=SUB|FN|SUBS)|[A-Z419]+(?!=SUB|FN|SUBS)
Here are sample inputs from regex101.