Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
この文字列から二重引用符なしで URL を取得するにはどうすればよいですか:
<p>The document has moved <a href="http://xxx/aaa/index.html">here</a>.</p>
正規表現パターンを使用できますhttp:[^"]+
http:[^"]+
HTML文字列が「regexp.html」というファイルにあると仮定します
$ ruby -n -e 'm = $_.match(/(http[^"]+)/); puts m if m' < regexp.html http://xxx/aaa/index.html
これは、URL が「http」で始まる場合にのみ機能します。