Andy
Andy

Reputation: 19261

Javascript remove everything before special character?

I am trying remove everything before a string like

234234$12$34

Where everything is removed before the first found $ ? And then split the $12$34 to like $12,$34 ?

How am I able to do that in regex ?

Thanks

Upvotes: 3

Views: 1117

Answers (1)

georg
georg

Reputation: 215049

 parts = "234234$12$34".match(/\$[^$]+/g)

returns

 ["$12", "$34"]

Upvotes: 9

Related Questions