re = /\"[^\"]*[\u2E80-\u9FFF]+[^\"]*\"/
str = '// case ph_text_fill_item:
// v[TEST_TYPE_TEXT] = W2U(L"填空题");
// ((CTextRectObj*)pObjs[i])->SetTestAttrs(v);
// break;
// case ph_text_answer_fill_item:
// v[TEST_TYPE_TEXT] = W2U(L"解答题");
// ((CTextRectObj*)pObjs[i])->SetTestAttrs(v);
// break;
// case ph_text_answer_trueorfalse:
// v[TEST_TYPE_TEXT] = W2U(L"判断题");
// ((CTextRectObj*)pObjs[i])->SetTestAttrs(v);
'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html