PO Box Regular Expression Validation

前端 未结 11 2203
攒了一身酷
攒了一身酷 2020-12-05 03:19

Here\'s my code, but I can\'t ever trigger the alert.

$(document).ready( function (){
    $(\"[id*=\'txtAddress1S\']\").blur(function() {
        var pattern         


        
11条回答
  •  猫巷女王i
    2020-12-05 03:59

    Here's one that matches 'POB', 'PO Box'and 'Post Office Box'. Pattern:

    \\b[PO.|Post\\sOffice]*\\s?B(ox)?.*\\d+\\b.

    It's a modification of @drudge's solution.

提交回复
热议问题