Search code examples
regexvbasharepointreporting-servicesssrs-2008

Regular expression to replace Multi lookup values in sharepoint (ID;#) with a blank value


I have a SSRS report that displays multi lookup values as

1;#Entry 1;2;#Entry 2;3;#Entr 3;4;#Entries;5;#Pens;6;#8 Flipcharts;7;#22 TVs etc .

I want to display the values as

Entry 1;Entry2;Entry3;Entries;Pens;8 Flipcharts;22 TVs .

I tried the below code , but the code replaces the numbers in the value side with blank.

Function ScrubText(ByVal value As String) As String 
   Return System.Text.RegularExpressions.Regex.Replace(value,";#\d*;#", "; ").Trim() 
End Function

How to modify regular expression in the above code?


Solution

  • so now you should be replacing in steps first do this

    ";d;" with ";"
    

    then replace

    "#" with ""
    

    this should do the trick.