合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
```erlang 9> re:run("The sick quick brown fox.", "ick", [global]). {match,[[{5,3}],[{11,3}]]} 10> re:replace("The quick brown fox.", "brown", "red"). [<<"The quick ">>,<<"red">>|<<" fox.">>] 11> re:replace("The quick brown fox.", "brown", "red", [{return, list}]). "The quick red fox." 27> re:run("E-mail: xyz@pdq.com", "[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-z]{2,3}"). {match,[{8,11}]} 28> re:split("this/is/my/path","/"). [<<"this">>,<<"is">>,<<"my">>,<<"path">>] 29> {_, P} = re:compile("[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-z]{2,3}"). {ok,{re_pattern,0,0,<<69,82,67,80,164,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,64,...>>}} 30> re:run("E-mail: xyz@pdq.com", P). {match,[{8,11}]} get_url(String) -> HTTP_regex = "^(H|h)(T|t)(T|t)(P|p)(S|s)*://", case re:run(String, HTTP_regex) of nomatch -> not_url; {match, _} -> get_url1(String, []) end. 31.re:run( "fdsfdsfw1990.10.18fdsfsd", "\\d{4}.\\d{2}.\\d{2}" ). {match,[{8,10}]} 32.re:replace("The quick brown fox.", "brown", "red", [{return, list}]). "The quick red fox." 33.re:split( Html, "<script[^>]*?>.*?</script>",[{return,list},trim] ). 34. HtmlString2 = string:join(re:split( HtmlString1, "<script[^>]*?>.*?</script>",[{return,list},trim] ), ""), ```