in reply to Creating spacers in regex match
Use alternation to match the exact two substrings you intend to match.
m/\b16 03 01 (?:34 23|39 4b) 0b\b/
This regular expression pattern will only match the two substrings...
16 03 01 34 23 0b
16 03 01 39 4b 0b
The word boundary assertion \b ensures you won't wrongly match a substring like 916 03 01 34 23 0bf.
Jim
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating spacers in regex match
by muba (Priest) on Jul 09, 2011 at 02:32 UTC | |
by Jim (Curate) on Jul 09, 2011 at 05:25 UTC | |
by muba (Priest) on Jul 09, 2011 at 08:13 UTC |