#NEWLINE# def regexFlags( xc , p , args , n ) : #NEWLINE# #INDENT# f = 0 #NEWLINE# flagsArg = stringArg ( c , args , n , 'xs:string' , missingArgFallback = '' , emptyFallback = '' ) #NEWLINE# for c in flagsArg : #NEWLINE# #INDENT# if ( c == 's' ) : #NEWLINE# #INDENT# f |= re . S #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( c == 'm' ) : #NEWLINE# #INDENT# f |= re . M #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( c == 'i' ) : #NEWLINE# #INDENT# f |= re . I #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( c == 'x' ) : #NEWLINE# #INDENT# f |= re . X #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise XPathContext . XPathException ( p , 'err:FORX0001' , _ ( 'Regular expression interpretation flag unrecognized: {0}' ) . format ( flagsArg ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return f