I am fairly new to regex (and programming in general) and have a feeling I am using it very wrongly.
In a listbox’s “CellBackgroundPaint” event I have the following code,
var rx as new RegEx rx.SearchPattern = "Test" for row = Datalist.LastRowIndex downto 0 if rx.Search( Datalist.Cell( row, 2 ) ) is nil then g.drawpicture Test_20px,0,0 end if next
What I was trying to achieve was when the program runs, regex searches the list box (Column 2) for the word “Test” and when it finds it, it tags it with an icon which is stored in the application.
What happens is… nothing, no icon is drawn. But if I change the column to either 0 or 1 (or any column that doesn’t have “Test” in it) it draws the icon into all the cells.
I have a feeling I am going about this very wrong and hope someone can point me in the right direction.