okay.. Im not the best at writing reg exp so Im sure this is simple but Ive tried it a hundred different ways... Given a string I want to pull out the first occurance of all characters,digits,spaces and special chars between the [ and ]
for instance I usally have a string such as "[blah boo & foo] + [heeee]" I want to return "[blah boo & foo]" below is my feable attempt to get this...
Dim r As Regex = New Regex("\[.*\]")
Dim m As Match = r.Match(stringGoesHere)
Dim basdf As String = m.Value
"\[.*\]" is somewhat sucessful.. but it returns the whole string (obviously because the string starts and ends with [ ]. So I try something like \[\w*\s*\] and that only works for something like [booo] no [boo foo]. I guess Im stuck in the middle portion where I want everything between the [].. any help is much appreciated...
for instance I usally have a string such as "[blah boo & foo] + [heeee]" I want to return "[blah boo & foo]" below is my feable attempt to get this...
Dim r As Regex = New Regex("\[.*\]")
Dim m As Match = r.Match(stringGoesHere)
Dim basdf As String = m.Value
"\[.*\]" is somewhat sucessful.. but it returns the whole string (obviously because the string starts and ends with [ ]. So I try something like \[\w*\s*\] and that only works for something like [booo] no [boo foo]. I guess Im stuck in the middle portion where I want everything between the [].. any help is much appreciated...