I have a multi-line string :
273: ( 34, 50, 82) #223252 srgb(34,50,82)
204: ( 42, 49, 43) #2A312B srgb(42,49,43)
224: ( 84, 85, 60) #54553C srgb(84,85,60)
143: (148,141,114) #948D72 srgb(148,141,114
120: (166,151, 50) #A69732 srgb(166,151,50)
107: (168,157, 97) #A89D61 srgb(168,157,97)
206: (215,181, 82) #D7B552 srgb(215,181,82)
222: (222,198, 82) #DEC652 srgb(222,198,82)
1144: (239,184, 31) #EFB81F srgb(239,184,31)
1382: (241,200, 32) #F1C820 srgb(241,200,32)
I need to trim it using regex , whatever comes before '#' So far I am able to trim it from the first line using the pattern :
string pattern = @".+?(?=#)";
Output :
273: ( 34, 50, 82)
Expected output :
273: ( 34, 50, 82)
204: ( 42, 49, 43)
.
.
1382: (241,200, 32)
Even if out put is in a single array should be fine but I am getting only the first line , I know I can iterate through each line and get the output , but is there any better approach without iteration? How do I get the expected output ? Any help would be great