Considering the JavaScript RegExp and its declaration process you may declare a regular expression in JavaScript on the fly
var exp_blood = /^[A|a|B|b|AB|ab|O|o]{1,2}[+-]{1}$/;
or initialize it with its constructor RegExp
var exp_blood = new RegExp("/^[A|a|B|b|AB|ab|O|o]{1,2}[+-]{1}$/");
Considering this scenario I would like to build an object on the fly without initializing any constructor explicitly or with a finite/unique expression. I would like to declare an object without using its Constructor named HL7V2. I could create an object with its Constructor. For example:
var hl7 = new HL7V2("MSH|^~\&|SENDERAPP|SENDERFAC|COVCDR|COVCDR|20130212221503||ORU^R01|1676326503009050|P|2.6");
But my goal is to instantiate it on the fly like RegExp in JavaScript
var hl7 = MSH|^~\&|SENDERAPP|SENDERFAC|COVCDR|COVCDR|20130212221503||ORU^R01|1676326503009050|P|2.6;
Is it possible or any suggestion?
var exp_blood = /(?:[abo]|ab){1,2}[+-]$/i;