PLDB
Languages Features Calendar About Lists Add Language
GitHub icon

Hexadecimals

Hexadecimals

Hexadecimals are a language feature.

Base-16 number system that uses the digits 0-9+A-F. Often represented by putting a "0x" before the number. So 15 === 0xF and 256 === 0X100.

Languages with Hexadecimals include Java, JavaScript, Python, Go, Perl, Swift, MySQL, Haskell, Clojure, Prolog, Julia, Elixir, Ada, OCaml, Dart, F#, CoffeeScript, D, Chapel, Forth, Verilog, awk, Eiffel, Reason, PostScript, VHDL, Zig, Idris, WebAssembly, VBScript, Hy, ClojureScript, ActionScript, Boo, IDL, Protocol Buffers, AutoIt, Icon, SuperCollider, Agda, Opa, Ceylon, Ioke, F*, Zephir, Koka, Coq, K, Monkey, SystemVerilog, AutoHotkey, Cython, Pig Latin, Isabelle, Puppet, Transact-SQL, S, Thrift, Pony, Unicon, AspectJ, Futhark, QML, Nit, ooc, Felix, GLSL, Cryptol, Xtend, BlitzBasic, Whiley, Meson, Ragel, Golo, HLSL, BlitzMax, Logtalk, OpenEdge ABL, MiniD, Vim script, clay, SourcePawn, chaiscript, Linden Scripting Language, GDScript, monte, TAL, parasail, Earl Grey, Pawn, nimrod, FloScript, Flatline, Urbiscript, Kal, CBOR data definition language, Savi, SARL, RAISE Specification Language, Croc

Example from Java, AspectJ:

// 0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?

Example from JavaScript:

// 0[xX][0-9a-fA-F]+n? 0x4D06792

Example from Python:

# 0[xX](?:_?[a-fA-F0-9])+

Example from Go, Dart, Chapel, Koka, Linden Scripting Language:

// 0[xX][0-9a-fA-F]+

Example from Perl:

# 0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*

Example from Swift:

// 0x[0-9a-fA-F_]+

Example from MySQL:

-- x'([0-9a-f]{2})+'

Example from Haskell:

-- 0[xX]_*[\da-fA-F](_*[\da-fA-F])*

Example from Clojure:

; 0x-?[abcdef\d]+

Example from Prolog:

% 0x[0-9a-fA-F]+

Example from Julia:

# 0x[a-fA-F0-9]+((_[a-fA-F0-9]+)+)?

Example from Elixir:

# 0x[\da-fA-F]+

Example from Ada:

-- [0-9_]+#[0-9a-f_\.]+#

Example from F#:

// 0[xX][\da-fA-F][\da-fA-F_]*[uU]?[yslLn]?[fF]?

Example from CoffeeScript, awk:

# 0x[0-9a-fA-F]+

Example from D:

// 0[xX][0-9a-fA-F_]+

Example from Forth:

\ (\$[0-9A-F]+)

Example from Verilog:

// ([0-9]+)|(\'h)[0-9a-fA-F]+

Example from Eiffel:

-- 0[xX][a-fA-F0-9]+

Example from Reason:

// 0[xX][\da-fA-F][\da-fA-F_]*

Example from PostScript:

% <[0-9A-Fa-f]+>(?=[()<>\[\]{}/%\s])

Example from VHDL:

-- X"[0-9a-f_]+"

Example from Idris, Agda:

-- 0[xX][\da-fA-F]+

Example from VBScript:

' &h[0-9a-f]+

Example from Hy, AutoIt, AutoHotkey:

; 0[xX][a-fA-F0-9]+

Example from Boo:

# 0x[a-fA-F0-9]+

Example from Protocol Buffers:

// 0x[0-9a-fA-F]+[LlUu]*

Example from Icon, Unicon:

# \b([+-]?([2-9]|[12][0-9]|3[0-6])[rR][0-9a-zA-Z]+)\b

Example from SuperCollider, Zephir, QML, Whiley:

// 0x[0-9a-fA-F]+

Example from Ceylon:

// #([0-9a-fA-F]{4})(_[0-9a-fA-F]{4})+

Example from K:

/ [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}

Example from Monkey:

' \$[0-9a-fA-Z]+

Example from SystemVerilog:

// ([1-9][_0-9]*)?\s*\'[sS]?[hH]\s*[xXzZ?0-9a-fA-F][_xXzZ?0-9a-fA-F]*

Example from Pig Latin, Transact-SQL:

-- 0x[0-9a-f]+

Example from Felix:

// 0[xX][0-9a-fA-F_]+([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?

Example from Ragel:

# 0x[0-9A-Fa-f]+

Example from Golo, GDScript:

# 0[xX][a-fA-F0-9]+

Example from MiniD:

// 0[xX][0-9a-fA-F][0-9a-fA-F_]*

Article source

PLDB - Build the next great programming language 路 v2022 Docs Acknowledgements Email GitHub