Search

1/20/2008

Removing the script tags

/<script[^>]*>[\S\s]*?<\/script[^>]*>/ig

[^>] 指的是除了>的任何字元
[\S\s]是所有 unicode 字元的集合

[...] Any one character between the brackets.
[^...] Any one character not between the brackets.
. Any character except newline or another Unicode line terminator.
\w Any ASCII word character. Equivalent to [a-zA-Z0-9_].
\W Any character that is not an ASCII word character. Equivalent to
[^a-zA-Z0-9_].
\s Any Unicode whitespace character.
\S Any character that is not Unicode whitespace. Note that \w and \S are not the
same thing.
\d Any ASCII digit. Equivalent to [0-9].
\D Any character other than an ASCII digit. Equivalent to [^0-9].

沒有留言: