Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 474
Andy Avatar asked Dec 07 '25 07:12

Andy


1 Answers

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

returns

 ["$12", "$34"]
like image 176
georg Avatar answered Dec 08 '25 19:12

georg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!