種類
- モジュール関数 (8)
- 特異メソッド (5)
- インスタンスメソッド (3)
- 文書 (1)
ライブラリ
-
cgi
/ util (4) - erb (2)
-
rubygems
/ remote _ fetcher (2) - shellwords (3)
-
webrick
/ htmlutils (1) -
webrick
/ httputils (4)
クラス
- CGI (4)
-
Gem
:: RemoteFetcher (2) - String (1)
モジュール
-
ERB
:: Util (2) - Shellwords (2)
-
WEBrick
:: HTMLUtils (1) -
WEBrick
:: HTTPUtils (4)
キーワード
- escape8bit (1)
- escapeHTML (1)
-
escape
_ html (1) -
escape
_ path (1) -
html
_ escape (1) - shellescape (2)
- unescape (2)
- unescapeHTML (1)
-
unescape
_ html (1) - 正規表現 (1)
検索結果
先頭5件
-
String
# shellescape -> String (99958.0) -
文字列を Bourne シェルのコマンドライン中で安全に使えるようにエスケープします。
文字列を Bourne シェルのコマンドライン中で安全に使えるようにエスケープします。
string.shellescape は、Shellwords.escape(string) と等価です。
@return エスケープされた文字列を返します。
@see Shellwords.#shellescape -
WEBrick
:: HTMLUtils . # escape(string) -> String (63946.0) -
指定された文字列に含まれる ", &, <, > を文字実体参照に変換した文字列を 生成して返します。
指定された文字列に含まれる ", &, <, > を文字実体参照に変換した文字列を
生成して返します。
@param string エスケープしたい文字列を指定します。
require 'webrick'
p WEBrick::HTMLUtils.escape('/?q=foo&hl=<ja>') #=> "/?q=foo&hl=<ja>" -
Gem
:: RemoteFetcher # escape(str) -> String (63625.0) -
URI 文字列をエンコードした文字列を返します。
URI 文字列をエンコードした文字列を返します。
@param str 文字列を指定します。
@see URI.escape -
WEBrick
:: HTTPUtils . # escape(str) -> String (63625.0) -
与えられた文字列を数値参照文字列に変換します。
与えられた文字列を数値参照文字列に変換します。
以下の正規表現を使用して変換します。
control = (0x0..0x1f).collect{|c| c.chr }.join + "\x7f"
space = " "
delims = '<>#%"'
unwise = '{}|\\^[]`'
nonascii = (0x80..0xff).collect{|c| c.chr }.join
/[#{Regexp.escape(control + space + delims + unwise + nonascii)}]/n
@param str... -
Shellwords
. escape(str) -> String (63607.0) -
文字列を Bourne シェルのコマンドライン中で安全に使えるようにエスケープします。
文字列を Bourne シェルのコマンドライン中で安全に使えるようにエスケープします。
このメソッドは、Shellwords.#shellescape の別名です。
@param str エスケープの対象となる文字列を指定します。
@return エスケープされた文字列を返します。 -
ERB
:: Util . # h(s) -> String (54631.0) -
文字列 s を HTML用にエスケープした文字列を返します。
文字列 s を HTML用にエスケープした文字列を返します。
文字列 s 中に含まれる &"<> を、実体参照 & " < > にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。
@param s HTMLエスケープを行う文字列
//emlist[例][ruby]{
require "erb"
include ERB::Util
puts html_escape("is a > 0 & a < 10?")
# is a > 0 & a < 10?
//} -
Shellwords
. # shellescape(str) -> String (45904.0) -
文字列を Bourne シェルのコマンドライン中で安全に使えるようにエスケープします。
文字列を Bourne シェルのコマンドライン中で安全に使えるようにエスケープします。
@param str エスケープの対象となる文字列を指定します。
@return エスケープされた文字列を返します。
例:
require 'shellwords'
pattern = 'Jan 15'
puts "grep #{Shellwords.shellescape(pattern)} file"
# => grep Jan\ 15 file -
CGI
. escapeHTML(string) -> String (37234.0) -
与えられた文字列中の '、&、"、<、> を実体参照に置換した文字列を新しく作成し返します。
与えられた文字列中の '、&、"、<、> を実体参照に置換した文字列を新しく作成し返します。
@param string 文字列を指定します。
require "cgi"
p CGI.escapeHTML("3 > 1") #=> "3 > 1"
print('<script type="text/javascript">alert("警告")</script>')
p CGI.escapeHTML('<script type="text/javascript">alert("警告")</script>')
... -
CGI
. escape _ html(string) -> String (37234.0) -
与えられた文字列中の '、&、"、<、> を実体参照に置換した文字列を新しく作成し返します。
与えられた文字列中の '、&、"、<、> を実体参照に置換した文字列を新しく作成し返します。
@param string 文字列を指定します。
require "cgi"
p CGI.escapeHTML("3 > 1") #=> "3 > 1"
print('<script type="text/javascript">alert("警告")</script>')
p CGI.escapeHTML('<script type="text/javascript">alert("警告")</script>')
... -
CGI
. unescapeHTML(string) -> String (37231.0) -
与えられた文字列中の実体参照のうち、& > < " と数値指定がされているもの (�ffff など) を元の文字列に置換します。
与えられた文字列中の実体参照のうち、& > < "
と数値指定がされているもの (�ffff など) を元の文字列に置換します。
@param string 文字列を指定します。
require "cgi"
p CGI.unescapeHTML("3 > 1") #=> "3 > 1" -
CGI
. unescape _ html(string) -> String (37231.0) -
与えられた文字列中の実体参照のうち、& > < " と数値指定がされているもの (�ffff など) を元の文字列に置換します。
与えられた文字列中の実体参照のうち、& > < "
と数値指定がされているもの (�ffff など) を元の文字列に置換します。
@param string 文字列を指定します。
require "cgi"
p CGI.unescapeHTML("3 > 1") #=> "3 > 1" -
WEBrick
:: HTTPUtils . # escape _ path(str) -> String (36925.0) -
与えられた文字列を数値参照文字列に変換します。
与えられた文字列を数値参照文字列に変換します。
以下の正規表現を使用して変換します。
num = '0123456789'
lowalpha = 'abcdefghijklmnopqrstuvwxyz'
upalpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
mark = '-_.!~*\'()'
unreserved = num + lowalpha + upalpha + mark
/[^#{Regexp.escape(unreserved + ":@&=+$,")}]/n
@param str 文字列を指定します。... -
ERB
:: Util . # html _ escape(s) -> String (27931.0) -
文字列 s を HTML用にエスケープした文字列を返します。
文字列 s を HTML用にエスケープした文字列を返します。
文字列 s 中に含まれる &"<> を、実体参照 & " < > にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。
@param s HTMLエスケープを行う文字列
//emlist[例][ruby]{
require "erb"
include ERB::Util
puts html_escape("is a > 0 & a < 10?")
# is a > 0 & a < 10?
//} -
WEBrick
:: HTTPUtils . # escape8bit(str) -> String (27607.0) -
与えられた文字列を数値参照文字列に変換します。
与えられた文字列を数値参照文字列に変換します。
@param str 文字列を指定します。 -
Gem
:: RemoteFetcher # unescape(str) -> String (27604.0) -
URI 文字列をデコードした文字列を返します。
URI 文字列をデコードした文字列を返します。
@param str 文字列を指定します。
@see URI.unescape -
WEBrick
:: HTTPUtils . # unescape(str) -> String (27604.0) -
与えられた文字列を数値参照文字列から元の文字列に変換します。
与えられた文字列を数値参照文字列から元の文字列に変換します。
@param str 文字列を指定します。 -
正規表現 (265.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
正規表現
* metachar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references
正規表現(regular expression)は文字列のパタ...