-1

レールで動作していませんか?
statement= '<p>As he opened the door, Winston saw that he had left the diary open on the table. DOWN WITH BIG BROTHER was written in it, in letters you could almost <span style=\"text-decoration: underline;\">read</span> across the room.</p>\r\n<p>But everything was all right. A small, sad-looking woman was standing outside.</p>\r\n<p>'Oh, Comrade Smith,' she said, in a dull little voice, 'do you think you could come across and help me with our kitchen sink? The water isn't running away and ...'</p>\r\n<p>レールでpreg_match_allを実行する方法

result = statement.scan('/<span style="text-decoration: underline;">(.*)<\/span>/U') 
+0

あなたが与えている 'statement'が有効な文字列でない場合 – Sajin

答えて

1

このことができますかどうかを確認してください。 その後、

statement= "<p>As he opened the door, Winston saw that he had left the diary open on the table. DOWN WITH BIG BROTHER was written in it, in letters you could almost <span style='text-decoration: underline;'>read</span> across the room.</p>\r\n<p>But everything was all right. A small, sad-looking woman was standing outside.</p>\r\n<p>'Oh, Comrade Smith,' she said, in a dull little voice, 'do you think you could come across and help me with our kitchen sink? The water isn't running away and ...'</p>\r\n<p>".html_safe 

result = statement.scan(/<span style='text-decoration: underline;'>.*<\/span>/) 
#=> ["<span style='text-decoration: underline;'>read</span>"] 
関連する問題