export const CRowPluginRegExp = /\u0003(.*)\u0003/gi ; export const CRowNumberRegExp = /\u0002(\d*)\u0002/gi ; export const CSourceSignatureRegExp = /\u0011(.*)\u0011/gi ; export const CRowPluginDelimiterRegExp = /\u0003/gi ; export const CRowNumberDelimiterRegExp = /\u0002/gi ; export const CDLTColumnDelimiterRegExp = /\u0004/gi ; export const CDLTArgumentDelimiterRegExp = /\u0005/gi ; param { string } rowStr returns export function extractPluginId ( rowStr ) { const value = rowStr . match ( CRowPluginRegExp ) ; if ( value === null || value . length !== 1 ) { return - 1 ; } value [ 0 ] = value [ 0 ] . replace ( CSourceSignatureRegExp , '' ) . replace ( CRowPluginDelimiterRegExp , '' ) ; return parseInt ( value [ 0 ] . trim ( ) , 10 ) ; } param { string } rowStr returns export function extractRowPosition ( rowStr ) { const value = rowStr . match ( CRowNumberRegExp ) ; if ( value === null || value . length !== 1 ) { return - 1 ; } value [ 0 ] = value [ 0 ] . replace ( CRowNumberDelimiterRegExp , '' ) ; return parseInt ( value [ 0 ] . trim ( ) , 10 ) ; } export function clearRowStr ( rowStr ) { return rowStr . replace ( CRowNumberRegExp , '' ) . replace ( CRowPluginRegExp , '' ) ; } export function fullClearRowStr ( rowStr ) { return rowStr . replace ( CRowNumberRegExp , '' ) . replace ( CRowPluginRegExp , '' ) . replace ( CDLTColumnDelimiterRegExp , '\t' ) . replace ( CDLTArgumentDelimiterRegExp , ' ' ) ; }