# Partial Matching
Match incomplete or streaming input.
## Enabling Partial Matching
```rust
use fuzzy_regex::FuzzyRegexBuilder;
let re = FuzzyRegexBuilder::new("(?:hello){e<=1}")
.partial(true)
.build()
.unwrap();
```
## How It Works
When enabled, matches that reach the end of the input are marked as "partial":
```rust
let re = FuzzyRegexBuilder::new("(?:hello){e<=1}")
.partial(true)
.build()
.unwrap();
// Match at end of text - partial
let m1 = re.find("hello").unwrap();
assert!(m1.partial());
// Match not at end - not partial
let m2 = re.find("say hello").unwrap();
assert!(!m2.partial());
// Fuzzy match reaching end - also partial
let m3 = re.find("hallo").unwrap();
assert!(m3.partial());
```
## Use Cases
### Streaming Input
```rust
use fuzzy_regex::FuzzyRegexBuilder;
let re = FuzzyRegexBuilder::new("(?:command){e<=1}")
.partial(true)
.build()
.unwrap();
let mut stream = re.stream();
// Feed incomplete data
for m in stream.feed(b"cmd") {
if m.partial() {
println!("Partial match: might be complete when more data arrives");
}
}
```
### Progressive Matching
```rust
// Check if more input needed
let m = re.find("incomplete");
}
```
## Without Partial
By default (`partial(false)`), partial matches behave the same as full matches:
```rust
let re = FuzzyRegexBuilder::new("(?:hello){e<=1}")
.partial(false) // default
.build()
.unwrap();
let m = re.find("hello").unwrap();
assert!(!m.partial()); // Always false
```