テキスト ファイルがあり、そのテキスト ファイルを読み取って、正規表現に一致するすべてのテキストを見つけようとしています。パラメータが括弧なしの場合にうまく機能します。
これは機能します:
from_str = "this is a text"
また、テキストに括弧が含まれている場合は機能しません。
from_str = "this is a text with (parenthesis)"
これが私の完全なコードです:
from_str = "this is a text with (parenthesis)"
str_to_text = "Freddie Mac Form"
text = File.open(texturl).read
text = text.scan(/#{from_str}(.*?)#{str_to_text}/m)[0]
abort text.to_s # Returning no data