=FormulaProof
1

FormulaProof · Evidence

Execution log

REGEXMATCH does not see what the cell displays

Ran
Engine
Google Sheets (live, via Sheets API v4)
Locale
en_US
Host
Windows_NT 10.0.26200 · Node v24.15.0
Result
38 of 38 as expected
Cell Formula What Google returned
B1 =REGEXMATCH("2026-07-10","^2026")

control: a text cell is the text you see

Typed as text, or imported as text. This is the case that works, and it is why the problem is confusing.

TRUE
B2 =REGEXMATCH(DATE(2026,7,10),"^2026")

the same date, entered as a date

The cell reads 2026-07-10. The pattern is handed something else.

#VALUE!
B3 =REGEXEXTRACT(DATE(2026,7,10),"\d+")

what the pattern is actually handed

#VALUE!
B4 =REGEXMATCH(DATE(2026,7,10),"2026")

so does the year appear anywhere in a real date

#VALUE!
B5 =REGEXMATCH(TEXT(DATE(2026,7,10),"yyyy-mm-dd"),"^2026")

the fix: hand the pattern a rendering, not a value

TRUE
B6 =REGEXMATCH(50%,"50")

a percentage cell is a fraction

The cell displays 50%. Half of one is 0.5.

#VALUE!
B7 =REGEXEXTRACT(50%,".+")

what a percentage looks like to a pattern

#VALUE!
B8 =REGEXMATCH(1240,"^\$")

currency is a number wearing a costume

Formatted as $1,240.00 in the sheet. The dollar sign and the comma belong to the format, not to the value.

#VALUE!
B9 =REGEXMATCH(1240,",")

and the thousands separator is not there either

#VALUE!
B10 =REGEXMATCH("007","^0")

a leading zero survives only in text

TRUE
B11 =REGEXMATCH(007,"^0")

the same employee id, entered as a number

#VALUE!
B12 =REGEXMATCH(5,"\.")

does a whole number carry a decimal point

#VALUE!
B13 =REGEXMATCH(ROUND(5,2),"\.")

does a number formatted to two places carry one

ROUND(5,2) displays as 5.00 in a currency column.

#VALUE!
B14 =REGEXEXTRACT(1/3,".+")

one third, handed to a pattern

How many digits does a pattern get to see? The cell shows however many the column is wide.

#VALUE!
B15 =REGEXEXTRACT(1234567890123456,".+")

a very large number

#VALUE!
B16 =REGEXEXTRACT(0.0000001,".+")

a very small one

If Sheets renders this in scientific notation, ^\d+$ stops being true of a number.

#VALUE!
B17 =REGEXMATCH(TRUE,"TRUE")

is a boolean a word

#VALUE!
B18 =REGEXMATCH(TRUE,"^1$")

is a boolean a number

#VALUE!
B19 =REGEXMATCH("","^$")

what an empty cell becomes

TRUE
B20 =REGEXMATCH(TIME(9,30,0),"9")

a time is a fraction of a day

#VALUE!
B21 =REGEXMATCH(TEXT(TIME(9,30,0),"hh:mm"),"^09:30$")

the same time, rendered first

TRUE
B22 =REGEXMATCH(TEXT(1240,"$#,##0.00"),"^\$1,240\.00$")

the general fix, on a currency column

TEXT() renders the value the way the format would, and hands the pattern a string.

TRUE
B23 =REGEXMATCH(DATE(2026,7,10)&"","^2026")

the workaround everyone recommends

Concatenating an empty string makes the value text. It does not make it the date you can see.

FALSE
B24 =REGEXEXTRACT(DATE(2026,7,10)&"",".+")

what &"" actually hands the pattern

46213
B25 =REGEXEXTRACT(50%&"",".+")

a percentage, coerced

0.5
B26 =REGEXMATCH(50%&"","50")

a percentage, coerced, asked whether it is fifty

FALSE
B27 =REGEXEXTRACT(1240&"",".+")

currency, coerced

The dollar sign and the comma were never in the value.

1240
B28 =REGEXMATCH(007&"","^0")

the employee id 007, coerced

FALSE
B29 =REGEXMATCH(ROUND(5,2)&"","\.")

5.00 in a currency column, coerced, asked for its decimal point

FALSE
B30 =REGEXEXTRACT(1/3&"",".+")

one third, coerced

How many digits does the coercion keep?

0.333333333333333
B31 =REGEXEXTRACT(1234567890123456&"",".+")

a sixteen-digit number, coerced

1234567890123450
B32 =REGEXEXTRACT(0.0000001&"",".+")

a very small number, coerced

Scientific notation would make ^\d+$ false of a number.

0.0000001
B33 =REGEXEXTRACT(TRUE&"",".+")

a boolean, coerced

TRUE
B34 =REGEXMATCH(TIME(9,30,0)&"","9")

9:30 in the morning, coerced, asked whether it contains a nine

A fraction of a day. Whether it contains a 9 is an accident of arithmetic.

TRUE
B35 =REGEXEXTRACT(TIME(9,30,0)&"",".+")

9:30 in the morning, coerced

0.395833333333333
B36 =REGEXEXTRACT(1240,"d+")

REGEXEXTRACT refuses a number the same way

#VALUE!
B37 =REGEXREPLACE(1240,"d","x")

REGEXREPLACE refuses a number the same way

#VALUE!
B38 =REGEXMATCH(1234567890123456&"","3456$")

the sixteenth digit of an id number

A card number, an invoice id, a bank reference. Entered as a number, not as text.

FALSE

Every row above was written into a real Google Sheet and read back through the Sheets API on 2026-07-26. The case file and this log are in the repository, and the build refuses to run if they disagree.

Why this page exists

Anyone can write that lookahead does not work in Google Sheets. It is in Google's documentation, one link away, and a language model will tell you the same thing in a second.

What almost nobody does is run it. So this page is the run. Each formula above was written into a cell through the Sheets API, and the value in the third column is what came back — not what we expected, not what the documentation says, not what a model predicted.

Some rows are marked observed. Those are cases where we did not know the answer beforehand, so we measured instead of asserting. Guessing and then presenting the guess as a finding is exactly the failure mode this site was built to avoid.

If any formula here changes what it does, the log goes stale and the site refuses to build. Tell us if you find one that is wrong before we do.