에서 문자열을 추출하는 방법, 추출 루비 정규식을 사용하는 방법을 알고 싶습니다 "postreview --해야한다 - 더 - 원인"루비 정규식 : Rubular 나 매우 익숙하지 않은 URL
"{\"source_url\"=>\"http://testing.com/projects/postreview-should-be-the-cause\"}"
최고에서 나는지고있다
check_user = url.split(/\b(\w+)\b/)
=> ["{\"", "source_url", "\"=>\"", "http", "://", "localhost", ":", "3000", "/", "projects", "/", "postreview", "-", "should", "-", "be", "-", "the", "-", "cause", "\"}"]
아직도 다양한 방법을 시도하고있다. 미리 감사드립니다.
나는 이것이 새로운 방법인가? Model.find_by (puts result) – chickensmitten
"Model.find_by (puts result)"가 유효한 지 알려 줘야 겠어. =) – chickensmitten
http://ruby-doc.org/core-2.1.4/Regexp.html#method-i-match – hwnd