[問題] 怎麼刪除 space消失

看板RegExp (正規表示式 Regular Expression)作者時間14年前 (2010/01/09 23:01), 編輯推噓3(302)
留言5則, 3人參與, 最新討論串1/1
rtcb .org sesese .y145c .cn smophi .com shootersworld .cn suntravet .cn superhandycap .com sxicl .co .uk systemprotectinc .info tec .qc .cx therealsecurityshields .com tong-ji .com thesecuritynsyard .com tongji520 .com totalsecuritysite .com trfdb .net trustshield .info udta .in video4thjuly .com uhaulde .cn videoindependence .com ukropin .com vivalatube .com vpsvip .com wirtschaft-frieden .ch welivehere .cn workscan4 .info wthelp .cn www-facebook .net xs8g .com xmoviedownloads .cn yusitymp .com yourhandyhome .com 如果有一筆資料如上 . 怎麼將他空白的地方拿掉, 因為一行裡面有二個 URL, 如果一同到好處理, 但二個就不知怎麼寫 re 比較好 :p -- -- ※ 發信站: 批踢踢實業坊(ptt.cc)

01/09 23:07, , 1F
replace(/\s+\.|\.\s+./g , '.') 試試~
01/09 23:07, 1F

01/09 23:10, , 2F
看起來把點前面的 space 拿掉就可以了
01/09 23:10, 2F

01/09 23:42, , 3F
sed 's/ \.\([a-z]*\)/\.\1/g'
01/09 23:42, 3F

01/09 23:42, , 4F
感謝 <(_ _)>
01/09 23:42, 4F

01/14 15:47, , 5F
sed 's/ \./\./g' 這樣呢?
01/14 15:47, 5F
文章代碼(AID): #1BI9eqUL (RegExp)
文章代碼(AID): #1BI9eqUL (RegExp)