Question: I'm trying to modify an answer found [here](https://stackoverflow.com/questions/3887878/referencing-an-object-using-a-variable-string-in-visual-basic-2010) but I'm not having much luck....

What I'm trying to do is:

I have 12 pictures and 12 pictureboxes.
In a loop I'm trying to get it to check for the number and load the corresponding image(s)
so if it's #3 it should load images 1-3 in pictureboxes 1-3

I think I'm close but i can't figure it out

Declaration of Dictionary and passing subroutine

```
Dim ctrlDict As New Dictionary(Of Image, Control)
Dictionary(ctrlDict)

```

Definition Sub

```
 Sub dicti(pictures() As Image, ByRef ctrlDict As Dictionary(Of Image, Control))

    ctrlDict.Add(pictures(0), PictureBox1)
    ctrlDict.Add(pictures(1), PictureBox2)
    ctrlDict.Add(pictures(3), PictureBox3)

End Sub

```

Loop

The error I'm getting is "programname.my.resources is a namespace and cannot be used as an expression" and "picturebox is a type and cannot be used as an expression"

```
Sub Output(Days() As String, Prices() As String, WhichDay As String, total As Double, ctrlDict As Dictionary(Of Image, Control))

    For i As Integer = 0 To 11
        If WhichDay >= i Then
            ctrlDict(PictureBox & i).Image = pictures(i)
        End If
    Next
End Sub     

```

Answer: 
```
\S+\.mp3

```

Try this.See demo .

<http://regex101.com/r/yR3mM3/21>
I'm not good in regular expression so I do it in another way.
Try this code

```
   NSString *input = @"#EXTM3U\n #EXT-X-VERSION:3\n #EXT-X-ALLOW-CACHE:NO\n #EXT-X-TARGETDURATION:11\n #EXT-X-MEDIA-SEQUENCE:2933\n #EXTINF:10.031,\n media_w687716935_2933.mp3\n #EXTINF:10.031,\n media_w687716935_2934.mp3\n #EXTINF:10.031,\n media_w687716935_2935.mp3";
   NSArray *subBreakingLineStrings = [input componentsSeparatedByString:@"\n"];

    NSMutableArray *results = [NSMutableArray new];
    for (NSString *subString in subBreakingLineStrings) {
        if ([subString rangeOfString:@".mp3"].location != NSNotFound) {
            [results addObject:subString];
        }
    }

    NSLog(@"result = %@", results);

```

output:

```
result = (
    " media_w687716935_2933.mp3",
    " media_w687716935_2934.mp3",
    " media_w687716935_2935.mp3"
)

```