Below, there are some useful regular expressions for matching C-like primitive data values.

Before presenting the regular expressions I’ll introduce you first some named patterns:

```/* universal character name */
UCN (\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})

/* exponent part of a floating point number */
EXP ([Ee][-+]?[0-9]+)

/* length part of an integer number */
ILEN ([Uu](L|l|LL|ll)?|(L|l|LL|ll)[Uu]?)
```

Having the above named patterns as basic building blocks we can describe more complex information.

For integer numbers:

```/* integer in octal form */
0[0-7]*{ILEN}?

/* integer in decimal form */
[1-9][0-9]*{ILEN}?

/* integer in hexadecimal form */
0[Xx][0-9a-fA-F]+{ILEN}?
```

For floating point numbers:

```/* floating point number in decimal form */
([0-9]*\.[0-9]+|[0-9]+\.){EXP}?[flFL]?
[0-9]+{EXP}[flFL]?

/* floating point number in hexadecimal form */
0[Xx]([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.?)[Pp][-+]?[0-9]+[flFL]?
```

For character and string literals:

```/* character literal */
\'([^'\\]|\\['"?\\abfnrtv]|\\[0-7]{1,3}|\\[Xx][0-9a-fA-F]+|{UCN})+\'

/* string literal */
L?\"([^"\\]|\\['"?\\abfnrtv]|\\[0-7]{1,3}|\\[Xx][0-9a-fA-F]+|{UCN})*\"
```

The following regular expression is for matching identifiers and does not describe a primitive data value. However, because it is a very important regular expression in most compilers and is related with primitive data types and values we present it:

```/* identifier */
([_a-zA-Z]|{UCN})([_a-zA-Z0-9]|{UCN})*
```
{"ft_lang_label":"__label__en","ft_lang_prob":0.5143884,"math_prob":0.990086,"size":1449,"snap":"2023-14-2023-23","text_gpt3_token_len":483,"char_repetition_ratio":0.121107265,"word_repetition_ratio":0.011764706,"special_character_ratio":0.37957212,"punctuation_ratio":0.110320285,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9544896,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-09T08:07:47Z\",\"WARC-Record-ID\":\"<urn:uuid:77ee7301-b933-4849-a493-09fc88c609a5>\",\"Content-Length\":\"180339\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a50927a7-3e4d-4d2a-99c9-f4cc4205b102>\",\"WARC-Concurrent-To\":\"<urn:uuid:58d83cf7-9b8f-40c1-9da1-f473a9b51326>\",\"WARC-IP-Address\":\"192.0.78.24\",\"WARC-Target-URI\":\"https://efxa.org/2014/05/10/regular-expressions-for-matching-data-values-in-compiler-lexers/\",\"WARC-Payload-Digest\":\"sha1:G4EXMLL5JLWQYGPL4UOFS75TAKUKKKC4\",\"WARC-Block-Digest\":\"sha1:5KQHGKOLOLDLWKUILB5XYRWRSSOURLBH\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224655446.86_warc_CC-MAIN-20230609064417-20230609094417-00038.warc.gz\"}"}