'Open Source man Is Pretty Brilliant'.match(/ ./)
'Open source man Is Pretty Brilliant'.match(/ ./, 9)
我下面這個字符串:http://rubymonk.com/learning/books/1-ruby-primer/chapters/5-strings/lessons/8-string-advanced查找紅寶石使用正則表達式
有人能解釋它們,我無法理解他們。
謝謝。
'Open Source man Is Pretty Brilliant'.match(/ ./)
'Open source man Is Pretty Brilliant'.match(/ ./, 9)
我下面這個字符串:http://rubymonk.com/learning/books/1-ruby-primer/chapters/5-strings/lessons/8-string-advanced查找紅寶石使用正則表達式
有人能解釋它們,我無法理解他們。
謝謝。
和尚明確表示
When the second parameter is present, it specifies the position
in the string to begin the search.
師父說:
"I'm not pleased with your question at all. Its unclear and there is no proof of effort"
更新
'Open Source man Is Pretty Brilliant'.match(/ ./) #=> only one parameter
'Open Source man Is Pretty Brilliant'.match(/ ./, 9) #=> 9 is the second parameter.
師父說:
"There's nothing equal to paying attention to what you read and what you practice.
Outside this there is no Ruby, there is no Java"
你的問題是什麼?你想找什麼子串? – Bala
@Singleton aah!我很抱歉。請看鏈接。 –
你不明白,正則表達式只是一個空格後面的字符。 –