# MatchInfo Class

## Definition

The object returned by select-string representing the result of a match.

public ref class MatchInfo
[Windows::Foundation::Metadata::WebHostHidden]
class MatchInfo
public class MatchInfo
type MatchInfo = class
Public Class MatchInfo
Inheritance
MatchInfo

## Properties

 The context for the match, or null if -context was not specified. Returns the base name of the file containing the matching line. It will be the string "InputStream" if the object came from the input stream. This is a readonly propery calculated from Path. Indicates if the match was done ignoring case. Returns the text of the matching line. Returns the number of the matching line. A list of all Regex matches on the matching line. The full path of the file containing the matching line. It will be "InputStream" if the object came from the input stream. Returns the pattern that was used in the match.

## Methods

 Returns the path of the matching file truncated relative to the directory parameter. For example, if the matching path was c:\foo\bar\baz.c and the directory argument was c:\foo the routine would return bar\baz.c Returns the string representation of this object. The format depends on whether a path has been set for this object or not. If the path component is set, as would be the case when matching in a file, ToString() would return the path, line number and line text. If path is not set, then just the line text is presented. Returns the string representation of the match object same format as ToString() but trims the path to be relative to the directory argument.