我使用Webrick
+ CGI
,当我实例化时,返回一个错误:(offline mode: enter name=value pairs on standard input)
Run Code Online (Sandbox Code Playgroud)irb(main):001:0> require 'cgi' => true irb(main):002:0> cgi = CGI.new (offline mode: enter name=value pairs on standard input)
我有标签:
val = "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Mobile Web</a>"
Run Code Online (Sandbox Code Playgroud)
在我的测试中:
val[/(>.*<)/]
Run Code Online (Sandbox Code Playgroud)
回报:
>Mobile Web<
Run Code Online (Sandbox Code Playgroud)
我想要返回文字:
Mobile Web
Run Code Online (Sandbox Code Playgroud)