正規表現メモ ひらがな カタカナ

ひらがな

function check_hiragana( $str ) {

mb_regex_encoding('UTF-8');

$result = true;
if (!preg_match("/^[ぁ-ゞー]+$/u",$str)) {
$result = false;
}

return $result;
}

カタカナ

function check_katakana( $str ) {

mb_regex_encoding('UTF-8');

$result = true;
//音引き'', 半角スペース,全角スペースこみ
if ( !preg_match("/^[ァ-ヶー  ]*$/u",$str) ) {
$result = false;
}
return $result;
}

public function validateKatakana($attribute, $value, $parameters) {
if (preg_match ( "/^[ァ-ヾ]+$/u", $value )) {
return true;
}
return false;
}

public function validateAlphaNum($attribute, $value, $parameters) {
if (preg_match("/^[a-zA-Z0-9_-]+$/", $value)) {
return true;
}
return false;
}

 

9/23

尊敬できる先輩起業家を間近で見て悔しかった。

自分がやりたい、作りたいと思う、自分の理想に近い経営を目の前で見せつけられた。

 

プロダクト、組織づくり、メンバーのキャリア育成、経営哲学、すべてにおいてブレない。

 

24h仕事のこと考えて楽しそうなのが単純にうらやましい。

 

俺にできないはずはない。

壁はあるけど超えるイメージはできている。

9/19

朝目標、todoリストつくったか no
事業アイディア思いついたか  no

ダイエットキュレーション × 何か 
考える時間は取れたか yes

事業リサーチしたか no

今日新たに10個海外サービス知れたか

 

 

今日のよかったこと 

中目のスタバに仮想通貨の本があったから読んでみようと思う

embulk 環境設定

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.rpm
yum localinstall jdk-8u40-linux-x64.rpm
curl --create-dirs -o ~/bin/embulk -L http://dl.embulk.org/embulk-latest.jar
chmod +x ~/bin/embulk

embulk gem install embulk-output-elasticsearch_using_url
embulk gem install embulk-input-mysql

 

 

/embulkで環境変数を設定
export EMBULK_ENV=production
export EMBULK_ENV=staging
export EMBULK_ENV=dev

php 静的解析

phpdcd インストール
wget https://phar.phpunit.de/phpdcd.phar
chmod +x phpdcd.phar
mv phpdcd.phar /usr/local/bin/phpdcd

https://github.com/sebastianbergmann/phpdcd

 

phpmd インストール
https://matome.naver.jp/odai/2134971273831838401

 

phpunit

install
https://blog.shimabox.net/2016/09/15/phpunit-php-support-version/

mysql 外部からアクセスを許可する

ローカルでの設定

 

mysql ユーザー許可ポート追加
grant all privileges on *.* to ユーザー名@"%" identified by 'password' with grant option;

 

grant all privileges on *.* to root@"%" identified by 'root' with grant option;


vim /etc/my.cnf
bind-address = 0.0.0.0

netstat -ant | grep LISTEN