キャメルケースの文字列を単語ごとに分割する
import re
str = 'getSampleTextFromDB'
[x for x in re.split('([a-z]+)([A-Z][a-z]+)|([A-Z][a-z]+)', str) if x != None and x != '']
実行結果
['get', 'Sample', 'Text', 'From', 'DB']
Go to list of users who liked
More than 5 years have passed since last update.
キャメルケースの文字列を単語ごとに分割する
import re
str = 'getSampleTextFromDB'
[x for x in re.split('([a-z]+)([A-Z][a-z]+)|([A-Z][a-z]+)', str) if x != None and x != '']
実行結果
['get', 'Sample', 'Text', 'From', 'DB']
Register as a new user and use Qiita more conveniently
Go to list of users who liked