The first pattern won’t work because the space between a number and a letter is not considered a word break, so \\b will not match there.
I’m not sure if the items you’re interested in start each line or can be mixed into text, but assuming the latter and the digits are important, this will do it:
rex.SearchPattern = "\\b([a-z]{2})(\\d{4})"
On every match, the first subexpression will be the letters and the second will be the digits.
That’s fine too. By default, Xojo’s PCRE implementation is case-insensitive. If that is changed in code through the RegEx.Options or the code[/code] switch, my way would stop working if the data is indeed as shown. From that perspective, your way is probably better.
BTW, that’s why RegExRX includes the switch when copying the pattern for use in Xojo or other languages, so there is no confusion.
I watch quietly from the sidelines but thanks to Kem I have become a user of regular expressions. It can be a whole lot easier than trying to program stuff. Thanks!