Regular Expressions 101

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(((([A-Z]+-)?((\d{2})([A-Z]{3})(\d{2}))?([A-Z]{3})?( )?((.[0-9A-Z]{3})|([0-9A-Z]{2}))( )([X][\/])?((E\/)|(B\/)|(T\/)|(L\/))*(([A-Z][\/-])?[A-Z]{3})?(?!\d{1,3}[A-Z\s])( )?(((E\/XXX)?|([Q]{1}(( )?([A-Z]{3})([A-Z]{3}))?(\d+M)?(\d{1,6}(\.\d{1,4})?))?|(M( )?([A-Z]{6})?( )?(\d{1,6}(\.\d{1,4})?)?)?|([R]{1}(\d+M)?(\d{1,6}(\.\d{1,4})?))?|(([0-9])*S(\d+M)?(\d{1,6}(\.\d{1,4})?))?|(M?\/(IT))|(M?\/(BT))|(\/\/([A-Z]{3})))( )?)*(\d+M( )?)?((?![0-9][A-Z])\d{1,6}(\.\d{1,4})?( )?)?((?<=[0-9])((?![A-Z][A-Z0-9]( )([A-Z]\/)?[A-Z]{3}|NUC|END|[A-Z]{3}( )[0-9])|(?=[A-Z][A-Z0-9]( )NUC))[A-Z][A-Z0-9\/]{0,8})?(( )?(([Q]{1}(\d+M)?(\d{1,6}(\.\d{1,4})?))|(P R\/([A-Z]{3})(\/)?([A-Z]{3})?( )?(\d+M)?(\d{1,6}(\.\d{1,4})?))|(P( )([A-Z]{6})( )?([A-Z]{6})?( )?(\d+M)?(\d{1,6}(\.\d{1,4})?))|(M( )?([A-Z]{6})?( )?(\d{1,6}(\.\d{1,4})?)?)|(H( )([A-Z]{6})( )?(\d{1,6}(\.\d{1,4})?))|(U( )(( )?([A-Z]{6}))+( )?(\d{1,6}(\.\d{1,4})?))|(C\/([A-Z]{3})(( )?[A-Z]{6})*( )?(\d{1,6}(\.\d{1,4})?))|(D( )((([A-Z])+\/)?([A-Z]{6})( )?((M)|(\d+M)|( )|(\d{1,6}(\.\d{1,4})?))( )?)+)|(\/-([A-Z]{3}))|(\/\/([A-Z]{3})))?( )?)*)+)+)( )?((( )?([A-Z]{3})( )?(\d{1,6}(\.\d{1,4})?))( )?(END)|(END))( )?(ROE( )?\d+(\.\d+)?)?(.*)?$
/
g

Description

no description available

Submitted by anonymous - 7 years ago