toml
title = "TOML Example"
title1adb = 100
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00
enabled = true
ports = [ 8000, 8001, 8002 ]
data = [ ["delta", "phi"], [3.14] ]
temp_targets = { cpu = 79.5, case = 72.0 }
ip = "10.0.0.1"
role = "frontend"
ip = "10.0.0.2"
role = "backend"
name = "apple"
abc = [1,2,]
color = "red"
shape = "round"
name = "red delicious"
name = "granny smith"
name = "banana"
name = "plantain"
str1 = "Hello, world!"
str2 = 'Hello, "world"!'
str3 = 'Hello, \'world\'!'
int1 = 42
int2 = +42
int3 = -42
float1 = 3.14
float2 = +3.14
float3 = -3.14
bool1 = true
bool2 = false
date1 = 2023-06-16
time1 = 13:30:00
datetime1 = 2023-06-16T13:30:00Z
flt1 = +1.0
flt2 = 3.1415
flt3 = -0.01
flt4 = 5e+22
flt5 = 1e06
flt6 = -2E-2
flt7 = 6.626e-34
arr1 = [1, 2, 3]
arr2 = [
"apple",
"banana",
"cherry"
]
arr3 = [
{ name = "Alice", age = 30 },
{ name = "Bob", age = 40 }
]
arr4 = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
name = "Alice"
age = 30
name = "Bob"
age = 40
name = "Charlie"
age = 50
city = "New York"
state = "NY"
string_field = "Hello, world!"
int_field = 42
name = "Alice"
age = 30
name = "syntaxlight"
version = "0.0.1"
description = "syntax highlight based on EBNF"
authors = ["luzhixing12345 <luzhixing12345@163.com>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/luzhixing12345/syntaxlight"
documentation = "https://luzhixing12345.github.io/syntaxlight/"
python = "^3.10"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
key = "value"
another = "# 这不是一个注释"
"127.0.0.1" = "value"
"character encoding" = "value"
"ʎǝʞ" = "value"
'key2' = "value"
'quoted "value"' = "value"
"" = "blank"
'' = 'blank'
name = "Orange"
physical.color = "orange"
physical.shape = "round"
site."google.com" = true
fruit.name = "banana"
fruit. color = "yellow"
fruit . flavor = "banana"
str1 = """
Roses are red
Violets are blue"""
str4 = """这有两个引号:"".够简单."""
str5 = """这有三个引号:""\"."""
str6 = """这有十五个引号:""\"""\"""\"""\"""\"."""
str7 = """这,"她说,"只是个无意义的条款."""
winpath = 'C:\Users\nodejs\templates'
winpath2 = '\\ServerX\admin$\system32'
quoted = 'Tom "Dubs" Preston-Werner'
regex = '<\i\c*\s*>'
regex2 = '''I [dw]on't need \d{2} apples'''
lines = '''
原始字符串中的
第一个换行被剔除了.
所有其它空白
都保留了.
'''
quot15 = '''这有十五个引号:"""""""""""""""'''
apos15 = "这有十五个撇号:'''''''''''''''"
str = ''''那,'她说,'仍然没有意义.'''