aerospike
aerospike
is a package which provides a Python client for Aerospike database clusters.
The Aerospike client enables you to build an application in Python with an Aerospike cluster as its database. The client manages the connections to the cluster and handles the transactions performed against it.
Note
See Data_Mapping
.
Note
If the client's config dictionary has a serializer and deserializer in the serialization tuple, then it will take precedence over the ones from set_serializer
and set_deserializer
.
The following example shows the three modes of serialization:
- Built-in
- Class-level user functions
- Instance-level user functions
Records foo1
and foo2
should have different encodings from each other since they use different serializers. (record foo3
uses the same encoding as foo2
) If we read the data for each record using aql
, it outputs the following data:
aql> select bin from test.demo where PK='foo1'
+-------------------------------------------------------------+--------+
| bin | PK |
+-------------------------------------------------------------+--------+
| 80 04 95 09 00 00 00 00 00 00 00 4B 01 4B 02 4B 03 87 94 2E | "foo1" |
+-------------------------------------------------------------+--------+
1 row in set (0.000 secs)
OK
aql> select bin from test.demo where PK='foo2'
+----------------------------+--------+
| bin | PK |
+----------------------------+--------+
| 5B 31 2C 20 32 2C 20 33 5D | "foo2" |
+----------------------------+--------+
1 row in set (0.001 secs)
OK
These are the keys and expected values for the config
dictionary passed to aerospike.client
.
Only the hosts key is required; the rest of the keys are optional.
config
- hosts (
list
) A list of tuples identifying a node (or multiple nodes) in the cluster.
The tuple is in this format:
(address, port, [tls-name])
- address:
str
- port:
int
- tls-name:
str
The client will connect to the first available node in the list called the seed node. From there, it will learn about the cluster and its partition map.
If
tls-name
is specified, it must match the tls-name specified in the node's server configuration file, as well as the server's CA certificate.- address:
- hosts (
- lua (
dict
) (Optional) Contains the paths to two types of Lua modules
- system_path (
str
) The location of the system modules such as
aerospike.lua
Default:
/usr/local/aerospike/lua
- system_path (
- user_path (
str
) The location of the user's record and stream UDFs .
Default:
./
- user_path (
- lua (
- policies (
dict
) A
dict
of policies- read (
dict
) Contains
aerospike_read_policies
.
- read (
- write (
dict
) Contains
aerospike_write_policies
.
- write (
- apply (
dict
) Contains
aerospike_apply_policies
.
- apply (
- operate (
dict
) Contains
aerospike_operate_policies
.
- operate (
- remove (
dict
) Contains
aerospike_remove_policies
.
- remove (
- query (
dict
) Contains
aerospike_query_policies
.
- query (
- scan (
dict
) Contains
aerospike_scan_policies
.
- scan (
- batch (
dict
) Contains
aerospike_batch_policies
.
- batch (
- total_timeout (
int
) Deprecated: set this individually in the
aerospike_polices
dictionaries.The default connection timeout in milliseconds
- total_timeout (
- auth_mode
The authentication mode with the server.
See
auth_mode
for possible values.Default:
aerospike.AUTH_INTERNAL
- login_timeout_ms (
int
) Representing the node login timeout in milliseconds.
Default:
5000
.
- login_timeout_ms (
- key
Deprecated: set this individually in the
aerospike_polices
dictionaries.Default key policy.
See
POLICY_KEY
for possible values.
- exists
Deprecated: set in the
aerospike_write_policies
dictionaryDefault exists policy.
See
POLICY_EXISTS
for possible values.
- max_retries (
int
) Deprecated: set this individually in the
aerospike_polices
dictionaries.Representing the number of times to retry a transaction
- max_retries (
- replica
Deprecated: set this in one or all of the following policy dictionaries:
aerospike_read_policies
aerospike_write_policies
aerospike_apply_policies
aerospike_operate_policies
aerospike_remove_policies
Default replica policy.
See
POLICY_REPLICA
for possible values.
- commit_level
Deprecated: set this as needed individually in the following policy dictionaries:
aerospike_write_policies
aerospike_apply_policies
aerospike_operate_policies
aerospike_remove_policies
Default commit level policy.
See
POLICY_COMMIT_LEVEL
for possible values.
- policies (
- shm (
dict
) Contains optional shared-memory cluster tending parameters
Shared-memory cluster tending is on if the
dict
is provided. If multiple clients are instantiated and talking to the same cluster the shm cluster-tending should be used.- max_nodes (
int
) Maximum number of nodes allowed.
Pad this value so new nodes can be added without configuration changes.
Default:
16
- max_nodes (
- max_namespaces (
int
) Maximum number of namespaces allowed.
Pad this value so new namespaces can be added without configuration changes.
Default:
8
- max_namespaces (
- takeover_threshold_sec (
int
) Take over tending if the cluster hasn't been checked for this many seconds
Default:
30
- takeover_threshold_sec (
- shm_key
Explicitly set the shm key for this client.
If use_shared_connection is not set, or set to
False
, the user must provide a value for this field in order for shared memory to work correctly.If, and only if, use_shared_connection is set to
True
, the key will be implicitly evaluated per unique hostname, and can be inspected withClient.shm_key
.It is still possible to specify a key when using use_shared_connection = True.
Default:
0xA8000000
- shm (
- use_shared_connection (
bool
) Indicates whether this instance should share its connection to the Aerospike cluster with other client instances in the same process.
Default:
False
- use_shared_connection (
- tls (
dict
) Contains optional TLS configuration parameters.
Note
TLS usage requires Aerospike Enterprise Edition. See TLS.
- enable (
bool
) Indicating whether tls should be enabled or not.
Default:
False
- enable (
- cafile (
str
) Path to a trusted CA certificate file.
By default TLS will use system standard trusted CA certificates
- cafile (
- capath (
str
) Path to a directory of trusted certificates.
See the OpenSSL SSL_CTX_load_verify_locations manual page for more information about the format of the directory.
- capath (
- protocols (
str
) Specifies enabled protocols. This format is the same as Apache's SSLProtocol documented at https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslprotocol .
If not specified the client will use "-all +TLSv1.2".
- protocols (
- cipher_suite (
str
) Specifies enabled cipher suites.
The format is the same as OpenSSL's Cipher List Format documented at https://www.openssl.org/docs/manmaster/apps/ciphers.html .
If not specified, the OpenSSL default cipher suite described in the ciphers documentation will be used. If you are not sure what cipher suite to select, this option is best left unspecified.
- cipher_suite (
- keyfile (
str
) Path to the client's key for mutual authentication.
By default, mutual authentication is disabled.
- keyfile (
- keyfile_pw (
str
) Decryption password for the client's key for mutual authentication.
By default, the key is assumed not to be encrypted.
- keyfile_pw (
- cert_blacklist (
str
) Path to a certificate blacklist file.
The file should contain one line for each blacklisted certificate. Each line starts with the certificate serial number expressed in hex. Each entry may optionally specify the issuer name of the certificate (serial numbers are only required to be unique per issuer).
Example records:
867EC87482B2 /C=US/ST=CA/O=Acme/OU=Engineering/CN=Test Chain CA E2D4B0E570F9EF8E885C065899886461
- cert_blacklist (
- certfile (
str
) Path to the client's certificate chain file for mutual authentication.
By default, mutual authentication is disabled.
- certfile (
- crl_check (
bool
) Enable CRL checking for the certificate chain leaf certificate.
An error occurs if a suitable CRL cannot be found.
By default CRL checking is disabled.
- crl_check (
- crl_check_all (
bool
) Enable CRL checking for the entire certificate chain.
An error occurs if a suitable CRL cannot be found.
By default CRL checking is disabled.
- crl_check_all (
- log_session_info (
bool
) Log session information for each connection.
- log_session_info (
- for_login_only (
bool
) Log session information for each connection.
Use TLS connections only for login authentication. All other communication with the server will be done with non-TLS connections.
Default:
False
(Use TLS connections for all communication with server.)
- for_login_only (
- tls (
- send_bool_as (
int
) Configures the client to encode Python booleans as the native Python boolean type, an integer, or the server boolean type.
Use one of the
send_bool_as_constants
constant values.See
Data_Mapping
for more information.Default:
aerospike.PY_BYTES
- send_bool_as (
- serialization (
tuple
) An optional instance-level tuple of
(serializer, deserializer)
.Takes precedence over a class serializer registered with
~aerospike.set_serializer
.
- serialization (
- thread_pool_size (
int
) Number of threads in the pool that is used in batch/scan/query commands.
Default:
16
- thread_pool_size (
- max_socket_idle (
int
) Maximum socket idle time in seconds.
Connection pools will discard sockets that have been idle longer than the maximum. It's important to set this value to a few seconds less than the server's proto-fd-idle-ms, so the client does not attempt to use a socket that has already been reaped by the server.
The value is limited to 24 hours (86400 seconds).
Default:
0
(disabled) for non-TLS connections55
for TLS connections
- max_socket_idle (
- max_conns_per_node (
int
) Maximum number of pipeline connections allowed for each node
- max_conns_per_node (
- tend_interval (
int
) Polling interval in milliseconds for tending the cluster
Default:
1000
- tend_interval (
- compression_threshold (
int
) Deprecated: set in the
aerospike_write_policies
dictionaryCompress data for transmission if the object size is greater than a given number of bytes
Default:
0
, meaning 'never compress'
- compression_threshold (
- cluster_name (
str
) Only server nodes matching this name will be used when determining the cluster name.
- cluster_name (
- rack_id (
int
) Rack id where this client instance resides.
Default:
0
- rack_id (
- rack_aware (
bool
) Track server rack data.
This is useful for:
- Directing read operations to run on the same rack as the client.
- Lowering cloud provider costs when nodes are distributed across different availability zones (represented as racks).
In order to enable this functionality:
rack_id
needs to be set to the local rack's ID- The client config's
aerospike_read_policies
needs to be set toPOLICY_REPLICA_PREFER_RACK
- The server rack configuration must be configured.
Default:
False
- rack_aware (
- use_services_alternate (
bool
) Flag to signify if "services-alternate" should be used instead of "services".
Default:
False
- use_services_alternate (
- connect_timeout (
int
) Initial host connection timeout in milliseconds. The timeout when opening a connection to the server host for the first time.
Default:
1000
.
- connect_timeout (
Operators for the single-record, multi-operation transaction method :pyClient.operate
.
Note
Starting version 3.4.0, it is highly recommended to use the aerospike_operation_helpers.operations
to create the arguments for :pyClient.operate
and :pyClient.operate_ordered
Old style operatiors are deprecated. The docs for old style operators were removed in client 6.0.0.
Specifies the number of replicas required to be successfully committed before returning success in a write operation to provide the desired consistency guarantee.
POLICY_COMMIT_LEVEL_ALL
Return succcess only after successfully committing all replicas
POLICY_COMMIT_LEVEL_MASTER
Return succcess after successfully committing the master replica
Read policy for AP (availability) namespaces.
POLICY_READ_MODE_AP_ONE
Involve single node in the read operation.
POLICY_READ_MODE_AP_ALL
Involve all duplicates in the read operation.
3.7.0
Read policy for SC (strong consistency) namespaces.
POLICY_READ_MODE_SC_SESSION
Ensures this client will only see an increasing sequence of record versions. Server only reads from master.
POLICY_READ_MODE_SC_LINEARIZE
Ensures ALL clients will only see an increasing sequence of record versions. Server only reads from master.
3.7.0
POLICY_READ_MODE_SC_ALLOW_REPLICA
Server may read from master or any full (non-migrating) replica. Increasing sequence of record versions is not guaranteed.
POLICY_READ_MODE_SC_ALLOW_UNAVAILABLE
Server may read from master or any full (non-migrating) replica or from unavailable partitions. Increasing sequence of record versions is not guaranteed.
Specifies the behavior for writing the record depending whether or not it exists.
POLICY_EXISTS_CREATE
Only create a record given it doesn't exist
POLICY_EXISTS_CREATE_OR_REPLACE
Replace a record completely if it exists, otherwise create it
POLICY_EXISTS_IGNORE
Update a record if it exists, otherwise create it
POLICY_EXISTS_REPLACE
Only replace a record completely if it exists
POLICY_EXISTS_UPDATE
Only update a record if it exists
Specifies the behavior of record modifications with regard to the generation value.
POLICY_GEN_IGNORE
Write a record regardless of generation
POLICY_GEN_EQ
Write a record only if generations are equal
POLICY_GEN_GT
Write a record only if local generation is greater than remote generation
Specifies the behavior for whether keys or digests should be sent to the cluster.
POLICY_KEY_DIGEST
Calculate the digest on the client-side and send it to the server
POLICY_KEY_SEND
Send the key in addition to the digest. This policy causes a write operation to store the key on the server
Specifies which partition replica to read from.
POLICY_REPLICA_SEQUENCE
Always try node containing master partition first.
If connection fails and the client is configured to retry, it will try the node containing prole partition. Currently restricted to master and one prole.
POLICY_REPLICA_MASTER
Read from the partition master replica node
POLICY_REPLICA_ANY
Distribute reads across nodes containing key's master and replicated partition in round-robin fashion.
Currently restricted to master and one prole.
POLICY_REPLICA_PREFER_RACK
Try node on the same rack as the client first.
If there are no nodes on the same rack, use POLICY_REPLICA_SEQUENCE
instead.
Specifies the TTL constants.
TTL_NAMESPACE_DEFAULT
Use the namespace default TTL.
TTL_NEVER_EXPIRE
Set TTL to never expire.
TTL_DONT_UPDATE
Do not change the current TTL of the record.
Specifies the type of authentication to be used when communicating with the server.
AUTH_INTERNAL
Use internal authentication only.
Hashed password is stored on the server. Do not send clear password.
AUTH_EXTERNAL
Use external authentication (like LDAP).
Specific external authentication is configured on server. If TLS defined, send clear password on node login via TLS.
Throw exception if TLS is not defined.
AUTH_EXTERNAL_INSECURE
Use external authentication (like LDAP).
Specific external authentication is configured on server. Send clear password on node login whether or not TLS is defined.
Warning
This mode should only be used for testing purposes because it is not secure authentication.
SCAN_PRIORITY
3.10.0 Scan priority has been replaced by the records_per_second
policy (see Scan aerospike_scan_policies
). Scan priority will be removed in a coming release.
SCAN_STATUS_ABORTED
1.0.50 used by Client.scan_info
SCAN_STATUS_COMPLETED
1.0.50 used by Client.scan_info
SCAN_STATUS_INPROGRESS
1.0.50 used by Client.scan_info
SCAN_STATUS_UNDEF
1.0.50 used by Client.scan_info
1.0.39
JOB_SCAN
Scan job type argument for the module parameter of Client.job_info
JOB_QUERY
Query job type argument for the module parameter of Client.job_info
JOB_STATUS_UNDEF
JOB_STATUS_INPROGRESS
JOB_STATUS_COMPLETED
1.0.50
SERIALIZER_PYTHON
Use the cPickle serializer to handle unsupported types (default)
SERIALIZER_USER
Use a user-defined serializer to handle unsupported types. Must have been registered for the aerospike class or configured for the Client object
SERIALIZER_NONE
Do not serialize bins whose data type is unsupported
1.0.47
Specifies how the Python client will write Python booleans.
PY_BYTES
Write Python Booleans as PY_BYTES_BLOBs.
This is Python's native boolean type.
INTEGER
Write Python Booleans as integers.
AS_BOOL
Write Python Booleans as as_bools
.
This is the Aerospike server's boolean type.
Flags used by list write flag.
LIST_WRITE_DEFAULT
Default. Allow duplicate values and insertions at any index.
LIST_WRITE_ADD_UNIQUE
Only add unique values.
LIST_WRITE_INSERT_BOUNDED
Enforce list boundaries when inserting. Do not allow values to be inserted at index outside current list boundaries.
Note
Requires server version >= 4.3.0
LIST_WRITE_NO_FAIL
Do not raise error if a list item fails due to write flag constraints (always succeed).
Note
Requires server version >= 4.3.0
LIST_WRITE_PARTIAL
Allow other valid list items to be committed if a list item fails due to write flag constraints.
Return types used by various list operations.
LIST_RETURN_NONE
Do not return any value.
LIST_RETURN_INDEX
Return key index order.
LIST_RETURN_REVERSE_INDEX
Return reverse key order.
LIST_RETURN_RANK
Return value order.
LIST_RETURN_REVERSE_RANK
Return reverse value order.
LIST_RETURN_COUNT
Return count of items selected.
LIST_RETURN_VALUE
Return value for single key read and value list for range read.
Flags used by list order.
LIST_UNORDERED
List is not ordered. This is the default.
LIST_ORDERED
Ordered list.
Flags used by list sort.
aerospike.LIST_SORT_DEFAULT
Default. Preserve duplicates when sorting the list.
aerospike.LIST_SORT_DROP_DUPLICATES
Drop duplicate values when sorting the list.
Flags used by map write flag.
Note
Requires server version >= 4.3.0
MAP_WRITE_FLAGS_DEFAULT
Default. Allow create or update.
MAP_WRITE_FLAGS_CREATE_ONLY
If the key already exists, the item will be denied. If the key does not exist, a new item will be created.
MAP_WRITE_FLAGS_UPDATE_ONLY
If the key already exists, the item will be overwritten. If the key does not exist, the item will be denied.
MAP_WRITE_FLAGS_NO_FAIL
Do not raise error if a map item is denied due to write flag constraints (always succeed).
MAP_WRITE_FLAGS_PARTIAL
Allow other valid map items to be committed if a map item is denied due to write flag constraints.
Flags used by map write mode.
Note
This should only be used for Server version < 4.3.0
MAP_UPDATE
Default. Allow create or update.
MAP_CREATE_ONLY
If the key already exists, the item will be denied. If the key does not exist, a new item will be created.
MAP_UPDATE_ONLY
If the key already exists, the item will be overwritten. If the key does not exist, the item will be denied.
Flags used by map order.
MAP_UNORDERED
Map is not ordered. This is the default.
MAP_KEY_ORDERED
Order map by key.
MAP_KEY_VALUE_ORDERED
Order map by key, then value.
Return types used by various map operations.
MAP_RETURN_NONE
Do not return any value.
MAP_RETURN_INDEX
Return key index order.
MAP_RETURN_REVERSE_INDEX
Return reverse key order.
MAP_RETURN_RANK
Return value order.
MAP_RETURN_REVERSE_RANK
Return reserve value order.
MAP_RETURN_COUNT
Return count of items selected.
MAP_RETURN_KEY
Return key for single key read and key list for range read.
MAP_RETURN_VALUE
Return value for single key read and value list for range read.
MAP_RETURN_KEY_VALUE
Return key/value items.
Note that key/value pairs will be returned as a list of keys and values next to each other:
[key1, value1, key2, value2, ...]
BIT_WRITE_DEFAULT
Allow create or update (default).
BIT_WRITE_CREATE_ONLY
If bin already exists the operation is denied. Otherwise the bin is created.
BIT_WRITE_UPDATE_ONLY
If bin does not exist the operation is denied. Otherwise the bin is updated.
BIT_WRITE_NO_FAIL
Do not raise error if operation failed.
BIT_WRITE_PARTIAL
Allow other valid operations to be committed if this operation is denied due to flag constraints. i.e. If the number of bytes from the offset to the end of the existing Bytes bin is less than the specified number of bytes, then only apply operations from the offset to the end.
3.9.0
BIT_RESIZE_DEFAULT
Add/remove bytes from the end (default).
BIT_RESIZE_FROM_FRONT
Add/remove bytes from the front.
BIT_RESIZE_GROW_ONLY
Only allow the bitmap size to increase.
BIT_RESIZE_SHRINK_ONLY
Only allow the bitmap size to decrease.
3.9.0
BIT_OVERFLOW_FAIL
Operation will fail on overflow/underflow.
BIT_OVERFLOW_SATURATE
If add or subtract ops overflow/underflow, set to max/min value. Example: MAXINT + 1 = MAXINT.
BIT_OVERFLOW_WRAP
If add or subtract ops overflow/underflow, wrap the value. Example: MAXINT + 1 = MININT.
3.9.0
HLL_WRITE_DEFAULT
Default. Allow create or update.
HLL_WRITE_CREATE_ONLY
If the bin already exists, the operation will be denied. If the bin does not exist, a new bin will be created.
HLL_WRITE_UPDATE_ONLY
If the bin already exists, the bin will be overwritten. If the bin does not exist, the operation will be denied.
HLL_WRITE_NO_FAIL
Do not raise error if operation is denied.
HLL_WRITE_ALLOW_FOLD
Allow the resulting set to be the minimum of provided index bits. For intersect_counts and similarity, allow the usage of less precise HLL algorithms when minhash bits of all participating sets do not match.
3.11.0
Flags used by ~aerospike_helpers.operations.expression_operations.expression_write
.
EXP_WRITE_DEFAULT
Default. Allow create or update.
EXP_WRITE_CREATE_ONLY
If bin does not exist, a new bin will be created. If bin exists, the operation will be denied. If bin exists, fail with BinExistsError when EXP_WRITE_POLICY_NO_FAIL is not set.
EXP_WRITE_UPDATE_ONLY
If bin exists, the bin will be overwritten. If bin does not exist, the operation will be denied. If bin does not exist, fail with BinNotFound when EXP_WRITE_POLICY_NO_FAIL is not set.
EXP_WRITE_ALLOW_DELETE
If expression results in nil value, then delete the bin. Otherwise, return OpNotApplicable when EXP_WRITE_POLICY_NO_FAIL is not set.
EXP_WRITE_POLICY_NO_FAIL
Do not raise error if operation is denied.
EXP_WRITE_EVAL_NO_FAIL
Ignore failures caused by the expression resolving to unknown or a non-bin type.
Flags used by ~aerospike_helpers.operations.expression_operations.expression_read
.
EXP_READ_DEFAULT
Default.
EXP_READ_EVAL_NO_FAIL
Ignore failures caused by the expression resolving to unknown or a non-bin type.
AS_BYTES_UNDEF
(int): 0
AS_BYTES_INTEGER
(int): 1
AS_BYTES_DOUBLE
(int): 2
AS_BYTES_STRING
(int): 3
AS_BYTES_BLOB
(int): 4
AS_BYTES_JAVA
(int): 7
AS_BYTES_CSHARP
(int): 8
AS_BYTES_PYTHON
(int): 9
AS_BYTES_RUBY
(int): 10
AS_BYTES_PHP
(int): 11
AS_BYTES_ERLANG
(int): 12
AS_BYTES_HLL
(int): 18
AS_BYTES_MAP
(int): 19
AS_BYTES_LIST
(int): 20
AS_BYTES_GEOJSON
(int): 23
AS_BYTES_TYPE_MAX
(int): 24
__version__
A str
containing the module's version.
1.0.54
UDF_TYPE_LUA
UDF type is LUA (which is the only UDF type).
INDEX_STRING
An index whose values are of the aerospike string data type.
INDEX_NUMERIC
An index whose values are of the aerospike integer data type.
INDEX_GEO2DSPHERE
An index whose values are of the aerospike GetJSON data type.
INDEX_TYPE_LIST
Index a bin whose contents is an aerospike list.
INDEX_TYPE_MAPKEYS
Index the keys of a bin whose contents is an aerospike map.
INDEX_TYPE_MAPVALUES
Index the values of a bin whose contents is an aerospike map.
LOG_LEVEL_TRACE
LOG_LEVEL_DEBUG
LOG_LEVEL_INFO
LOG_LEVEL_WARN
LOG_LEVEL_ERROR
LOG_LEVEL_OFF
Permission codes define the type of permission granted for a user's role.
PRIV_READ
The user is granted read access.
PRIV_WRITE
The user is granted write access.
PRIV_READ_WRITE
The user is granted read and write access.
PRIV_READ_WRITE_UDF
The user is granted read and write access, and the ability to invoke UDFs.
PRIV_SYS_ADMIN
The user is granted the ability to perform system administration operations. Global scope only.
PRIV_USER_ADMIN
The user is granted the ability to perform user administration operations. Global scope only.
PRIV_DATA_ADMIN
User can perform systems administration functions on a database that do not involve user administration. Examples include setting dynamic server configuration. Global scope only.
PRIV_TRUNCATE
User can truncate data only. Requires server 6.0+
PRIV_UDF_ADMIN
User can perform user defined function(UDF) administration actions. Examples include create/drop UDF. Global scope only. Global scope only. Requires server version 6.0+
PRIV_SINDEX_ADMIN
User can perform secondary index administration actions. Examples include create/drop index. Global scope only. Requires server version 6.0+
Flags used by the aerospike_operation_helpers.expressions.base.CmpRegex
Aerospike expression. See aerospike_operation_helpers.expressions
for more information.
REGEX_NONE
Use default behavior.
REGEX_ICASE
Do not differentiate case.
REGEX_EXTENDED
Use POSIX Extended Regular Expression syntax when interpreting regex.
REGEX_NOSUB
Do not report position of matches.
REGEX_NEWLINE
Match-any-character operators don't match a newline.