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}
ito perform a case-insensitive search (otherwise is case-sensitive)m- Matches the start and end of each line using ^ and $ (multi-line)<br/>(not only begin/end of string) {:.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`
Summary
- Category: String Manipulation
- Section:
5.6.11 - Return Type:
Boolean - Empty Input Result:
empty - Errors on Multiple Input:
true
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
regex:String- Regular expression to match againstflags(optional):String- Optional flags for the regex (i for case-insensitive, m for multi-line)
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