mechanize:Mechanize::Page#forms_with

以下のような HTML で

<html>
<head>
<title>form test</title>
</head>
<body>

<form method="post" action="cgi/foo00.cgi" name="form1">
</form>

<form method="post" action="cgi/foo01.cgi" name="form2">
</form>

</body>
</html>
>> require 'mechanize'
=> true
>> agent = Mechanize.new
=> #<Mechanize:0xb74782d8 ...
>> page = agent.get('http://127.0.0.1:8080/test01_form.html')
=> #<Mechanize::Page
 {url #<URI::HTTP:0xb7474a20 URL:http://127.0.0.1:8080/test01_form.html>}
  ...
>> page.forms_with(:action => %r|cgi/|) {|x| puts x }
#<Mechanize::Form:0xb746c99c>
#<Mechanize::Form:0xb746ad04>
=> [#<Mechanize::Form
 {name "form1"}
 {method "POST"}
 {action "cgi/foo00.cgi"}
 {fields}
 {radiobuttons}
 {checkboxes}
 {file_uploads}
 {buttons}>
, #<Mechanize::Form
 {name "form2"}
 {method "POST"}
 {action "cgi/foo01.cgi"}
 {fields}
 {radiobuttons}
 {checkboxes}
 {file_uploads}
 {buttons}>
]
>> page.forms_with(:action => "cgi/foo00.cgi") {|x| puts x }
#<Mechanize::Form:0xb746c99c>
=> [#<Mechanize::Form
 {name "form1"}
 {method "POST"}
 {action "cgi/foo00.cgi"}
 {fields}
 {radiobuttons}
 {checkboxes}
 {file_uploads}
 {buttons}>
]