How to get money when using regtest I want to experiment in the regtest network.
But I don't understand how I can get funds to play with.
I did:

bitcoind -regtest -daemon

bitcoin-cli -regtest sendtoaddress 2N3V4PeQXoD6TFM9ZvDMX81kzbuNtc5YPW4 1

and get:

error code: -6
error message:
Insufficient funds
Just generate some blocks.

bitcoin-cli -regtest generate 101


You will have them in your wallet and can use the funds once confirmed. 101 is the number of blocks to create.
You can use any integer that's at least 101 as the number of blocks.
You cannot use a smaller integer than 101 if you want to test transactions, because of the 100 block maturation time.