Text
python 정규표현식 예제
#!/usr/bin/env python # -*- encoding: utf-8 -*- import re country = re.compile(".*
\s*제조국\s*:\s*(?P.*?)
") made = re.compile(".*
\s*제조자/수입자\s*:\s*(?P.*?)
") txt = """
구매 전 필독
최대 수량 : 3,400개
1인당 50개까지 구매 가능
본 상품은 OK CASH BAG 사용/적립이 가능한 상품입니다.
상품정보제공 고시 상세정보
품명 및 모델명 : 블럭선반
재질 : 폴리프로필렌, 강선
구성품 : 선반 한 개
크기 : 40*25*19cm
동일모델의 출시년월 : 201202
제조자/수입자 : ㈜세창씨엔씨
제조국 : 한국
식품위생법에 따른 수입 신고 사항 : 해당사항 없음
품질보증기준 : 제품하자 및 배송파손시 환불가능, 제품개봉 및 사용후 반품불가
A/S 책임자와 전화번호 : 그루폰 고객센터(1661-0600)
위 내용은 전자상거래에 관한 상품정보제공 고시에 따라 작성되었습니다.
""" a = txt.replace(' ', '') print a result = re.match(country, a) try: print result.group("val").strip() except: print "" r = re.match(made, a) try: print r.group("val").strip() except: print ""
0 notes
Text
2013 년 연간 목표.
- showslow 구축하기 http://www.showslow.com/ - java for hadoop - glusterfs - python for script(with django) - RoR - 매일 영어 공부하기 - 매일 영작하기 - 매일 듣기 - daily 일기 쓰기 - 개인 wiki 구축
0 notes
Text
mysql explain
http://www.mysqlkorea.co.kr/sub.html?mcode=manual&scode=01&m_no=21444&cat1=7&cat2=217&cat3=227&lang=k
1 note
·
View note
Text
원격 DB 내용을 로컬 CSV 로 export 가 필요할 때. mysql -umysqlusername -pmysqlpass databsename -B -e "select * from \`tabalename\`;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > mysql_exported_table.csv
2 notes
·
View notes
Text
갑자기 인문학 서적들이 마구마구 땡긴다. 오랜만에 사서 볼 책들을 찾아봐야겠다.
0 notes