• Home
  • Observe and explore
  • Query data
  • Dynatrace Pattern Language
  • DPL Positional Matchers

Positional Matchers

Beginning of string

BOS, BOF

Matches beginning of string

output typequantifierconfiguration

none

none

none

Example

Extracting the first line in the string:

plaintext
"name";"age" Homer Simpson;40 Charles Montgomery Burns;104
plaintext
BOF LD:header EOL;

Results in the first line parsed into the header field. Parsing following lines fails, as they do not begin at the start of file marker.

header
''name'';''age''

Middle of string

MOS, MOF

Matches any bytes in the middle of string

output typequantifierconfiguration

none

none

none

Example

Extracting records after the first row in the string

plaintext
"name";"age" Homer Simpson;40 Charles Montgomery Burns;104
plaintext
MOF LD:name ';' INT:age EOL

Results in lines 2 and 3 parsed to fields name and age. Line 1 fails to parse as it begins with the beginning of the string marker.

nameage
-1
Homer Simpson40
Charles Montgomery Burns40

End of string

EOS, EOF

Matches end of string

output typequantifierconfiguration

none

none

none

Example

Extracting the last line of the string:

plaintext
"name";"age" Homer Simpson;40 Charles Montgomery Burns;104 total:2 persons, average age: 72 years

The following pattern matches only when the last line is followed by the end of string marker:

plaintext
LD:footer EOS

Results in the last line being extracted to the footer field. First three lines fail to parse as they are not the last in the string.

footer
total:2 persons, average age: 72 years