Notion 公式大全 正则表达式inside Formular
2021-08-03 15:05:10 1 举报
AI智能生成
Notion database Formular(functions)cheat shit
作者其他创作
大纲/内容
Text Functions
concat()
+
slice()
1origin string
2index begins at 0
3[optional]index end
2index begins at 0
3[optional]index end
join()
1delimiter:string
remaining:string
remaining:string
contains()
1string
2string
2string
re:boolean
test()
1string
2regEx
2regEx
re:boolean
format()
re:string
length()
re:number
replace()
1origin string
2regEx
3replacement string
2regEx
3replacement string
replaceAll()
Numeric Fuctions
toNumber()
unaryPlus()
add()
+
subtract()
-
multiply()
*
divide()
/
pow()
^
mod()
%
round()
ceil()
floor()
ln()
log10()
log2()
cbrt()
sqrt()
max()
min()
exp()
Euler's constant(2.718...)
abs()
sign()
1or-1or0
unaryMinus()
[number]*-1
Operators
Comparison Operators
!=
<=
==
>
<
>=
Arithmetic Operators
-
*
%
/
+
Constants
e
false
true
pi
reference
https://www.notion.vip/formulas/
Logic Functions
and()
1boolean
2boolean
2boolean
re:boolean
or()
not()
empty()
if()
equal()
==
larger()
>
largerEq()
>=
smaller()
<
smallerEq()
<=
unequal()
!=
Date Formats
Year
YY13
YYYY2013
Quater
Q1...4
Qo1st...4th
Month
M1...12
Mo1st...12th
MM01...12
MMMJan
MMMMJanuary
Week of year
w1...53
wo1st...53rd
ww01...53
Day of year
DDD1...365
DDDo1st...365th
DDDD001...365
Day
D1...31
Do1st...31st
DD01...31
Weekday
d0...6
ddSu
dddSun
ddddSunday
24h hour
H0...23
HH00...23
12h hour
h1...12
hh01...12
Minutes
m0...59
mm00...59
Seconds
s0...59
ss00...59
AM/PM
aam
AAM
Timezone offset
Z=+07:00
ZZ=+0730
Dciseconds
S0...9
SS00...99
Milliseconds
SSS000...999
Unix timestamp
X1581483600
Milisecond Unix timestamp
x1581483600000
Date&Time Fuctions
dateAdd()
1date
2amount
3unit
2amount
3unit
dateSubtract()
dateBetween()
1later date
2earlier date
3unit of the returned value
2earlier date
3unit of the returned value
start()
re:date
end()
formatDate()
timestamp()
fromTimestamp()
1timestamp
year()
re:number
month()
re:0~12
date()
re:1~31
hour()
re:0~23
minute()
re:0~59
day()
Sunday is 0
Monday is 1
Monday is 1
re:number
now()
re:date
Regular Expression
Character classes
.
except:\n, \r, \u2028 or \u2029
\w
[A-Za-z0-9]
\s
[ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]
\d
[0-9]
[\b]
backspace
\r
returen
\n
new line
\v
vertical Tab
\f
form feed
\0
NUL character
\cX
\xhh
\uhhhh
\u{hhhh} or \u{hhhhh}
\
special or not (escaped)
Quantifiers
x*
0 or more
x+
1 or more
x?
0 or 1
{n}
x{n,}
x{n,m}
x*?
x+?
x??
x{n}?
x{n,}?
x{n,m}?
x+?
x??
x{n}?
x{n,}?
x{n,m}?
non-greedy
eg:given a string like "some <foo> <bar> new </bar> </foo> thing":
/<.*>/ will match "<foo> <bar> new </bar> </foo>"
/<.*?>/ will match "<foo>"
/<.*>/ will match "<foo> <bar> new </bar> </foo>"
/<.*?>/ will match "<foo>"
Assertions
Boundary-type assertions
^
$
\b
word boundary
eg:/\bm/ matches the "m" in "moon"
\B
non-word boundary
Other assertions
x(?=pattern)
Lookahead
eg:/Jack(?=Sprat|Frost)/ matches "Jack" only if it is followed by "Sprat" or "Frost".
x(?!pattern)
Negative lookahead
(?<!pattern)x
Negative lookbehind
(?<=pattern)x
Groups and ranges
x|y
or
[xyz]
[z-c]
[z-c]
any one of
eg:[\w-] is same as [A-Za-z0-9_-]
[^xyz]
[^a-c]
[^a-c]
not
(x)
Capturing group
\n "n" is a positive integer
eg:apple(,)\sorange\1/ matches "apple, orange," in "apple, orange, cherry, peach".
\k<Name>
eg:/(?<title>\w+), yes \k<title>/ matches "Sir, yes Sir" in "Do you copy? Sir, yes Sir!".
(?<Name>x)
(?:x)
Non-capturing group
reference
https://regexper.com/
https://regexr.com/
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet
0 条评论
下一页