# StringNodeRule

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/anonymizer/StringNodeRule)

Declarative rule used for replacing sensitive data.

## Signature

```python
StringNodeRule()
```

## Extends

- `TypedDict`

## Constructors

```python
__init__(
    pattern: re.Pattern,
    replace: Optional[str],
)
```

| Name | Type |
|------|------|
| `pattern` | `re.Pattern` |
| `replace` | `Optional[str]` |


## Properties

- `pattern`
- `replace`

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/6a74bf5af9e542d8065af8edca54b2448f430916/python/langsmith/anonymizer.py#L71)