GVKun编程网logo

Phone format 正则表达式(pg 正则表达式)

1

如果您对Phoneformat正则表达式感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于Phoneformat正则表达式的详细内容,我们还将为您解答pg正则表达式的相关问题,

如果您对Phone format 正则表达式感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于Phone format 正则表达式的详细内容,我们还将为您解答pg 正则表达式的相关问题,并且为您提供关于$.format,jquery.format 使用说明_jquery、.NET String.Format()在数千个数字中添加逗号 - .NET String.Format () to add commas in thousands place for a number、Android Studio error: format not a string literal and no format arguments [-Werror=format-security]、Auto format Phone number的有价值信息。

本文目录一览:

Phone format 正则表达式(pg 正则表达式)

Phone format 正则表达式(pg 正则表达式)

Malaysia Phone format


"^((\\+60(\\s|-)?)|0)(((?!0)(?!2)(?!80)(?!81)\\d{1,2})[1]?)(\\s|-)?\\d{2,4}(\\s|-)?\\d{4}$"


all landline + mobile + IP in these format:

0XY YYXX XXXX or +60 XY YYXX XXXX

X must be there,Y may or not may be there depend on which number
example:
012 345 6789 or +60 12 345 6789 (normal mobile)
03 1234 5678 or +60 1234 5678 (selangor fix line)
088 12 3456 or +60 88 12 3456 (sabah fix line)
0111 123 4567 or +60 111 123 4567 (new mobile format)

space does not matter (accept without space too) or can be replace with dash (-)

do not accept bracket (common style to let people kNow the number can be omitted for local or STD call)
do not accept number to singapore (02),brunei (080) or any other unused NDC
do not accept NSN without trunk prefix (you don’t give people 12-345 6789)
do not accept country code + NSN without international call prefix too. it will confused people to give full number with country code without the plus sign.
do not accept input from stupid people who do not kNow the different between country code and trunk prefix (+6 03 1234 5678)
do not accept input from stupid people who try to separate subscribe number wrongly (+6011 123 456)


Singapure Phone format


"^[689]\\d{3}(\\s)?\\d{4}$"

$.format,jquery.format 使用说明_jquery

$.format,jquery.format 使用说明_jquery

复制代码 代码如下:

$.format = function (source, params) {
if (arguments.length == 1)
return function () {
var args = $.makeArray(arguments);
args.unshift(source);
return $.format.apply(this, args);
};
if (arguments.length > 2 && params.constructor != Array) {
params = $.makeArray(arguments).slice(1);
}
if (params.constructor != Array) {
params = [params];
}
$.each(params, function (i, n) {
source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n);
});
return source;
};

/*调用方法
var text = "a{0}b{0}c{1}d\nqq{0}";
var text2 = $.format(text, 1, 2);
alert(text2);
*/

.NET String.Format()在数千个数字中添加逗号 - .NET String.Format () to add commas in thousands place for a number

.NET String.Format()在数千个数字中添加逗号 - .NET String.Format () to add commas in thousands place for a number

问题:

I want to add a comma in the thousands place for a number. 我想在数千个数字中添加一个逗号。 String.Format() ? String.Format() 吗?


解决方案:

参考一: https://stackoom.com/question/RVy/NET-String-Format - 在数千个数字中添加逗号
参考二: https://oldbug.net/q/RVy/NET-String-Format-to-add-commas-in-thousands-place-for-a-number

Android Studio error: format not a string literal and no format arguments [-Werror=format-security]

Android Studio error: format not a string literal and no format arguments [-Werror=format-security]

使用 android studio, 如果编译 jni 过程出现如下错误:

error: format not a string literal and no format arguments [-Werror=format-security]


解决方法:
在你的 ndk 目录下修改 build/core/default-build-commands.mk

TARGET_FORMAT_STRING_CFLAGS := -Wformat -Werror=format-security



 

TARGET_FORMAT_STRING_CFLAGS := -Wformat   #-Werror=format-security

也就是把后面部分注释掉

Auto format Phone number

Auto format Phone number

 

Phone number (123)456-7890

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TEST.aspx.vb" Inherits="TEST" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <script language="javascript" type="text/javascript">

function ValidatePhone(txt){
var phone=txt.value;
if(phone.length==3){
    var pp=phone;
    var d4=phone.indexOf("(");
    var d5=phone.indexOf(")");
    if(d4==-1){    pp="("+pp;    }
    if(d5==-1){    pp=pp+")";    }
    txt.value=pp;
    }
if(phone.length>3){
    d1=phone.indexOf('(');
    d2=phone.indexOf(')');
    if (d2==-1){
        l30=phone.length;
        p30=phone.substring(0,4);
        p30=p30+")";
        p31=phone.substring(4,l30);
        pp=p30+p31;
        txt.value=pp;
    }
  }
if(phone.length>5){
    p11=phone.substring(d1+1,d2);
    if(p11.length>3){
        p12=p11;
        l12=p12.length;
        l15=phone.length;
        p13=p11.substring(0,3);
        p14=p11.substring(3,l12);
        p15=phone.substring(d2+1,l15);
        txt.value="";
        pp="("+p13+")"+p14+p15;
        txt.value=pp;
    }
    l16=phone.length;
    p16=phone.substring(d2+1,l16);
    l17=p16.length;
    if(l17>3&&p16.indexOf('-')==-1){
        p17=phone.substring(d2+1,d2+4);
        p18=phone.substring(d2+4,l16);
        p19=phone.substring(0,d2+1);
        pp=p19+p17+"-"+p18;
        txt.value=pp;
    }
}
}
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <asp:TextBox ID="TextBox1" runat="server" onkeyup='ValidatePhone(this)'></asp:TextBox>
    </form>
</body>
</html>

 

Phone number (123) 456-7890

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TEST.aspx.vb" Inherits="TEST" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
  

<script language="javascript" type="text/javascript">

function ValidatePhone(txt){
var d4;
var d5;
var d1;
var d2;
var pp;
var phone=txt.value;
if(phone.length==3){
     pp=phone;
     d4=phone.indexOf("(");
     d5=phone.indexOf(")");
    if(d4==-1){    pp="("+pp;    }
    if(d5==-1){    pp=pp+") ";    }
    txt.value=pp;
    }
if(phone.length>3){
     d1=phone.indexOf("(");
     d2=phone.indexOf(")");
    if (d2==-1){
        l30=phone.length;
        p30=phone.substring(0,4);
        p30=p30+") ";
        p31=phone.substring(4,l30);
        pp=p30+p31;
        txt.value=pp;
    }
  }
if(phone.length>5){
    p11=phone.substring(d1+1,d2);
    if(p11.length>3){
        p12=p11;
        l12=p12.length;
        l15=phone.length;
        p13=p11.substring(0,3);
        p14=p11.substring(3,l12);
        p15=phone.substring(d2+1,l15);
        txt.value="";
        pp="("+p13+") "+p14+p15;
        txt.value=pp;
    }
    l16=phone.length;
    p16=phone.substring(d2+2,l16);
    l17=p16.length;
    if(l17>3&&p16.indexOf("-")==-1){
        p17=phone.substring(d2+2,d2+5);
        p18=phone.substring(d2+5,l16);
        p19=phone.substring(0,d2+2);
        pp=p19+p17+"-"+p18;
        txt.value=pp;
    }
}
}
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <asp:TextBox ID="TextBox1" runat="server" onkeyup='ValidatePhone(this)'></asp:TextBox>
    </form>
</body>
</html>

今天的关于Phone format 正则表达式pg 正则表达式的分享已经结束,谢谢您的关注,如果想了解更多关于$.format,jquery.format 使用说明_jquery、.NET String.Format()在数千个数字中添加逗号 - .NET String.Format () to add commas in thousands place for a number、Android Studio error: format not a string literal and no format arguments [-Werror=format-security]、Auto format Phone number的相关知识,请在本站进行查询。

本文标签:

上一篇Validate and Format North American Phone Numbers (验证和格式化北美电话号码)(北美手机号码)

下一篇C#-“将应用程序与商店关联”选项未显示为Windows Phone 8.1 Silverlight项目的Visual Studio Ultimate 2013