Cobra Interactive Query Language contains


contains — retain or move mark if range associated with current mark contains the pattern(s)


	c[contains] [and] [no] [top|up] pattern [pattern2]


By default (without the and qualifier), this command is used to retain a current mark if the following two conditions are met:
  • the mark is associated with a range (e.g., a parenthesis, a brace, a bracket, or a user-defined range)
  • at least one token in that range matches the pattern(s) specified.
The use of the qualifier and changes the behavior by moving the marks to the matched tokens that are found within the range, instead of leaving the marks at the range as a whole. (Version 2.8 and later.)
The use of the qualifier no retains the mark only if the pattern is absent.
The use of the qualifier top restricts matches to the top nesting level.
The use of the qualifier up increases that to the nesting level one higher.

If the range corresponds to a (, ), [, ], {, or } token, then the nesting level is determined by that token.
If the range is user-defined, e.g., with a stretch command, then the nesting level is that of the surrounding block, as determined by the curly braces { and }.


	: m switch		# mark switch statements
	: n {			# move to next { token
	: c no top default	# switch without a default


jump, patterns, qualifiers, stretch

Return to index
(Last Updated: 13 February 2019)