View raw Markdown
type: fhirpath-functionfunction: matchesFullcategory: String Manipulationsection: 5.6.11source: fhirpath/functions.json

FHIRPath Function: matchesFull

{:.stu}

Note: The contents of this section are Standard for Trial Use (STU) {: .stu-note }

Returns true when the value completely matches the given regular expression (implying that the start/end of line markers ^, $ are always surrounding the regex expression provided). {:.stu} Regular expressions should function consistently, regardless of any culture- and locale-specific settings in the environment, should be case-sensitive, use 'single line' mode and allow Unicode characters. {:.stu}

If the input collection or regex are empty, the result is empty ({ }). {:.stu}

If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment. {:.stu}

The optional flags parameter can be set to: {:.stu}

'http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1'.matchesFull('Library') // returns false
'N8000123123'.matchesFull('N[0-9]{8}') // returns false as the string is not an 8 char number (it has 10)
'N8000123123'.matchesFull('N[0-9]{10}') // returns true as the string has an 10 number sequence in it starting with `N`

{:.stu}

Summary

Description

Returns true when the value completely matches the given regular expression. This is equivalent to surrounding the regex with ^ and $ but provides a more readable approach.

Arguments

Type Mapping

Example

'N80001231'.matchesFull('N[0-9]{8}') // returns true
'N8000123123'.matchesFull('N[0-9]{8}') // returns false as the string is not exactly an 8 char number