Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RegEx Question - Remove everything between : and ~

I am having trouble getting a regex to work. This is the string.

"some text would be here and Blah St:39.74908:-104.99482:272~Turn right over here"

I need to remove the

:39.74908:-104.99482:272~

part of the string. I am using jQuery if that helps.

like image 418
jhanifen Avatar asked Aug 03 '26 13:08

jhanifen


1 Answers

var str = "some text would be here and Blah St:39.74908:-104.99482:272~Turn right over here";
alert(str.replace(/:[^~]+~/g, ""));
like image 136
Tim Down Avatar answered Aug 06 '26 02:08

Tim Down