I need to match a number in a string to a specific list of numbers via StringRegExp.
I have successfully built an expression that matches the numbers to a list of possible matches but the two digit numbers are causing problems.
#include <MsgBoxConstants.au3>
Global $aValues[22] = ["B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "B10", "B11", "B12", "B13", "B14", "B15", "B16", "B17", "B18", "B19", "B20", "B21", "B22", "B23"]
For $i = 0 To 21
$iMatch = StringRegExp($aValues[$i], "(3)|(6)|(9)|(12)|(15)|(18)|(21)")
$Found = (($iMatch = 1) ? ("Found") : ("Not found") )
MsgBox($MB_SYSTEMMODAL, "Result", $Found & " in:" & @CRLF & $aValues[$i])
Next
As you can see, I want to only match if the string contains the literal whole number 3, 6, 9, 12, 15, 18, or 21. I mean the entire number. So three literally means "3". I don't want the number 13 or 23 to trigger a match. So, "B6" should evaluate as a match but "B16" should not.
I have tried many variations of the RegEx but the pattern above is the closest I can get.
Thank you all for your help!