Your regex can be simplified, and corrected to allow a character before the H
, to:
:32[^:]:.?([a-zA-Z]{6}\d[a-zA-Z]XXX)
The changes made were:
- Lost the look behind - just make it part of the match
- Inserting
.?
meaning "optional character" ([a-zA-Z]{4}[a-zA-Z]{2})
==>[a-zA-Z]{6}
(4+2=6)[0-9]
==>\d
(\d
means "any digit")[X]{3}
==>XXX
(just easier to read and less characters)
Group 1 of the match contains your target