2013-11-03 50 views
-2
'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查找紅寶石使用正則表達式

有人能解釋它們,我無法理解他們。

謝謝。

+0

你的問題是什麼?你想找什麼子串? – Bala

+0

@Singleton aah!我很抱歉。請看鏈接。 –

+0

你不明白,正則表達式只是一個空格後面的字符。 –

回答

1

和尚明確表示

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" 
+0

第二個參數是什麼? –

+0

請參閱更新。 – Bala

+0

在第一種情況下將搜索什麼 –