# [Perl 5] `-p`, 65 bytes

<!-- language-all: lang-perl -->

 $_=/^(0[0-7]*|0x\p{Hex}+|[1-9]\d*)u?l{0,2}u?$/i*!/lL|Ll/*!/u.*u/i

[Try it online!][TIO-kg8xdb8c]

[Perl 5]: https://www.perl.org/
[TIO-kg8xdb8c]: https://tio.run/##hVJda9swFH33r7hjhdlOHcsfsWVKKSMvGWgrDDoKbVeUWE417iRjS11C078@V3balz2sQrq60j3nonNQKzpcDH0M8zCOz3q@P4OP8Mv2Bh5EJ6DRHWyQd9LsQTdgHgRI1VoDXNWgrRnTEWNEb6TazoeT@/P4p09uSFTehQeyu22fVmL3PDvcJFF1d1uHgb3AJ3KaPtuLk1iGH2JkB4axS@w8tLEcBuIRUnp5at3CMVwxL6loWua0KotFRZOiKmle0iori4q64LK8WJSZZcwjO9oUnJMspRnNi3IthMiqrMpTih65XnLXnoL/TatIbwxHqOVWmsDxwP98PMDvUX@jEfUfuAYnbxd4UZ6CzwSvnUzo5VZxY51BslefnBvQ8s68OYTSiI5j4J7OEPxLhXtgbOyD6AjwyFHWR9tGtHYNp2D2rZhIboD/XdRW1VyZ6R76VmxkI0U3Iq7sO3V8B4AW/w9Ygf9FHR/6b5GskyQhxM0pHHfwf0zg5Wx2Cmv3K5Q2r0KXgbcSzsu/ujVSq36Ivi7mjjZELb4A "Perl 5 – Try It Online"