torres
torres

Reputation: 1353

Regular Expression to split by ;

17;#Nancy Williams;#894;#Brian Smith,;#895;#Kart Russell,

I tried ;# RegEx to split but the numbers and the comma after name are not needed.

Also, I have another scenario where the string looks like this

i:0#.w|domain\nWilliams;i:0#.w|domain\bSmith;i:0#.w|domain\kRussell;

Basically, I wanted the end result to look like domain\username; domain\username2... and so forth

and same for the first example.

Upvotes: 2

Views: 271

Answers (1)

lstern
lstern

Reputation: 1629

You can use

(;#)?[0-9]+;#

As your regular expression

Upvotes: 3

Related Questions