# Value
{: .no_toc }

Returns the text of the whole match.

Syntax: *object*.**Value**

*object*
: *required* An object expression that evaluates to a **Match**.

Returns a **String**. The property is read-only.

## Remarks

**Value** is the default member of **Match**, so an expression that needs a **String** can name the object alone.

The text is the part of the source string that begins at [**FirstIndex**](/tB/Packages/Contributed/tbRegExp/Match/FirstIndex.md) and has [**Length**](/tB/Packages/Contributed/tbRegExp/Match/Length.md) characters. The text captured by the groups of the pattern is in [**SubMatches**](/tB/Packages/Contributed/tbRegExp/Match/SubMatches.md).

## Example

```tb check_build check_run
Dim re As New RegExp
re.Pattern = "[a-z]+"

Dim m As Match
Set m = re.Execute("42 apples").Item(0)

Dim text As String
text = m.Value
Debug.Print text  ' apples

text = m          ' the default member is Value
Debug.Print text  ' apples
```

## See Also

- [FirstIndex](/tB/Packages/Contributed/tbRegExp/Match/FirstIndex.md) property -- the position where the match starts
- [Length](/tB/Packages/Contributed/tbRegExp/Match/Length.md) property -- the number of characters in the match
- [SubMatches](/tB/Packages/Contributed/tbRegExp/Match/SubMatches.md) property -- the text captured by the groups of the pattern
- [Match](/tB/Packages/Contributed/tbRegExp/Match/index.md) class -- overview
