CKPlus's Blog

Home Archives
2016-09-05

常用的 Regexp (Python)

濾掉空白

1
2
3
4
import re
pattern = re.compile(r'\s+')
sentence = re.sub(pattern, '', sentence)
Share
  • python
  • regexp
Newer
實用 Linux 小工具
Older
Python 時間/時區處理

Categories

  • elasticsearch
  • linux
  • python

Tags

  • admin
  • datetime
  • django
  • elasticsearch
  • es
  • linux
  • python
  • pytz
  • regexp
  • shard
  • ssh
  • virtualenv

Tag Cloud

admin datetime django elasticsearch es linux python pytz regexp shard ssh virtualenv

Archives

  • September 2016
  • August 2016
  • July 2016

Recent Posts

  • 實用 Linux 小工具
  • 常用的 Regexp (Python)
  • Python 時間/時區處理
  • 客製化 Django Admin Layout
  • SSH Tunnel 設定
© 2016 Eric Yu
Powered by Hexo
Home Archives