[help files] regex

https://help.libreoffice.org/6.2/en-US/text/scalc/01/func_regex.html

REGEX( Text ; Expression [ ; [ Replacement ] [ ; Flags|Occurrence ] ] )

is the second semicolon placed correctly? >[ ; Flags ] ?

Yes.⁠⁠⁠⁠⁠⁠

how? why?
why is the first semicolon a delimiter but the second delimiter is a square bracket?
none of the examples on that page reflect that. ?

=REGEX(“123456ABCDEF”;"[:digit:]";“Z”)
=REGEX(“123456ABCDEF”;"[:digit:]";“Z”;“g”)

The square brackets indicate optional parameters and not delimiters.

You’re right. thanks @anon73440385