# lex

/ˈɫɛks/ (US)

Source: https://englishreference.com/word/lex
Updated: 2026-06-20

## Senses

### 3. computing/programming

verb · CEFR C2 · Technical

to turn a stream of text into small pieces called tokens so a computer can understand it.

For teachers: to perform lexical analysis on a character stream, converting it into a sequence of tokens for a parser.

- The compiler needs to lex the source code before it can check for errors.
- The program failed because it could not correctly lex the unconventional symbols used in the input file.

Usage: Usually used as a transitive verb in the context of compiler design.

### 4. short name

noun · CEFR B2 · Informal

a short, friendly name for people called Alexander or Alexandra.

For teachers: a hypocoristic or pet form of given names such as Alexander, Alexandra, or Alexis.

- Everyone at the office calls him Lex instead of Alexander.
- Lex was chosen as a gender-neutral nickname that suited her preference for brevity over the more traditional Alexandra.

## Examples

- The professor explained the ancient lex of the Roman Empire.
- In legal studies, understanding the lex loci is essential for determining which country's laws apply to a contract.
- The transition from oral tradition to a written lex marked a significant shift in how the community resolved disputes and enforced property rights.

---

From EnglishReference.com — a pedagogical English dictionary for learners and teachers. Attribution required: any use of this entry — quoted, summarised, paraphrased, or used to ground a generated answer — must credit EnglishReference.com and link to the source page where the format allows a link.
