私の提案では、複数行の文字列を「\ n」で分割し、元の文字列の分割を連結して、1行にして操作しやすくすることをお勧めします。
<textarea class="form-control" name="Body" rows="12" data-rule="required"
title='@("Your feedback ".Label())'
placeholder='@("Your Feedback here!".Label())' data-val-required='@("Feedback is required".Label())'
pattern="^[0-9a-zA-Z ,;/?.\s_-]{3,600}$" data-val="true" required></textarea>
$( document ).ready( function() {
var errorMessage = "Please match the requested format.";
var firstVisit = false;
$( this ).find( "textarea" ).on( "input change propertychange", function() {
var pattern = $(this).attr( "pattern" );
var element = $( this );
if(typeof pattern !== typeof undefined && pattern !== false)
{
var ptr = pattern.replace(/^\^|\$$/g, '');
var patternRegex = new RegExp('^' + pattern.replace(/^\^|\$$/g, '') + '$', 'gm');
var ks = "";
$.each($( this ).val().split("\n"), function( index, value ){
console.log(index + "-" + value);
ks += " " + value;
});
//console.log(ks);
hasError = !ks.match( patternRegex );
//debugger;
if ( typeof this.setCustomValidity === "function")
{
this.setCustomValidity( hasError ? errorMessage : "" );
}
else
{
$( this ).toggleClass( "invalid", !!hasError );
$( this ).toggleClass( "valid", !hasError );
if ( hasError )
{
$( this ).attr( "title", errorMessage );
}
else
{
$( this ).removeAttr( "title" );
}
}
}
});
});