0
需要一點幫助才能形成正確工作的正則表達式(在ruby中)來匹配帶引號或不帶引號的字符串。正則表達式用於匹配帶有屬性的帶引號和不帶引號的文本
可能性,用戶可以給:
filename.png title:Title
"file name with spaces" title:Title alt:"Alternative text"
"filename.png" title:"Title"
文件名部分應該站出來爲一組,一切爲另一個,例如
=> 1: filename.png 2: title:Title
=> 1: file name with spaces 2: title:Title alt:"Alternative text"
=> 1: filename.png 2: title:"Title"
謝謝,在我的應用程序中像夢一樣工作。 – mikiancom 2012-07-13 06:14:41