---
title: "search(_:fullWordsOnly:caseMatchingOnly:)"
framework: pencilkit
role: symbol
role_heading: Instance Method
path: "pencilkit/pkstrokerecognizer/search(_:fullwordsonly:casematchingonly:)"
---

# search(_:fullWordsOnly:caseMatchingOnly:)

Searches the drawing for strokes whose recognized text matches the query.

## Declaration

```swift
final func search(_ query: String, fullWordsOnly: Bool = false, caseMatchingOnly: Bool = false) async -> [PKStrokeRecognizer.SearchResult]
```

## Parameters

- `query`: The query string to search for.
- `fullWordsOnly`: Restricts matches to whole words only.
- `caseMatchingOnly`: Restricts matches to exact case.

## Mentioned in

Recognizing handwriting and converting it to text

## Return Value

Return Value An array of all results found.

## See Also

### Searching for text

- [PKStrokeRecognizer.SearchResult](pencilkit/pkstrokerecognizer/searchresult.md)
