ASP removes spaces and numeric regular expressions from strings

Source: Internet
Author: User
Tags numeric regular expression
<script language= "Web Effects" type= "Text/javascript" >
var str;
Str= "Ten 3333 abc123";
var RG;
Rg=/[0-9]{1,}|s/ig;
var newstr=str.replace (RG, "");
document.write (NEWSTR);
</script>

Method Two

<script language= "javascript" type= "Text/javascript" >
var str;
Str= "Ten 3333 abc123";
var RG;
Rg=/[0-9]{1,}|s/ig;
var newstr=str.replace (RG, "");
document.write (NEWSTR);
</script>

Method Three

function Checkexp (PATRN, STRNG)

Dim regex, Match ' establishes the variable.

Set regex = new RegExp ' establishes a regular expression.

Regex.pattern = Patrn ' Set mode.

Regex.ignorecase = True ' Sets whether character case is case-sensitive.

Regex.global = True ' sets global availability.

matches = regex.test (strng) ' performs the search.

Checkexp = Matches

End Function

Method Four

$str = ' http://www.111cn.net/yun_qi_img/a.jpg ';
$part = ' | (Http://[a-za-z0-9/?&.] *) |si ';
$part 2 = ' | (http[s]?:/ /)? s*w. (?!) (jpg|gif|png)) W*|si ';
Preg_match_all ($part 2, $str, $STR);
Var_dump ($STR);

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.