def visitStringFacet(self, ctx: ShExDocParser.StringFacetContext):
if ctx.stringLength():<EOL><INDENT>slen = jsg.Integer(ctx.INTEGER().getText())<EOL>if ctx.stringLength().KW_LENGTH():<EOL><INDENT>self.nodeconstraint.length = slen<EOL><DEDENT>elif ctx.stringLength().KW_MINLENGTH():<EOL><INDENT>self.nodeconstraint.minlength = slen<EOL><DEDENT>else:<EOL><INDENT>self.nodeconstraint.maxlength = slen<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.nodeconstraint.pattern = jsg.String(self.context.fix_re_escapes(ctx.REGEXP().getText()[<NUM_LIT:1>:-<NUM_LIT:1>]))<EOL>if ctx.REGEXP_FLAGS():<EOL><INDENT>self.nodeconstraint.flags = jsg.String(ctx.REGEXP_FLAGS().getText())<EOL><DEDENT><DEDENT>
stringFacet: stringLength INTEGER | REGEXP REGEXP_FLAGS
            stringLength: KW_LENGTH | KW_MINLENGTH | KW_MAXLENGTH