Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wildcard matching doc #639

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions doc/wildcard_matching.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
### Matching rules

* An empty pattern "" will match any signal.
* A pattern without any asterisk - a path in other words - matches either a signal directly or any signal that is a direct or indirect child of the branch with that path.
* An asterisk "`*`" at the end of a pattern will match any signal that is a direct child of the branch(es) identified by the preceding pattern.
* A double asterisk "`**`" at the end of a pattern matches any signal that is a direct or indirect child of the branch(es) identified by the preceding pattern.
* An asterisk "`*`" in the middle (or beginning) of a pattern matches any signal that has a branch (of any name) at that position.
* A double asterisk "`**`" in the middle (or beginning) of a pattern matches any signal that has zero or more branches at that position.

### Examples

| Path | Matches |
|---------------------|--------------------------------------|
| `""` | Everything |
| `"Vehicle"` | Everything starting with `Vehicle` |
| `"Vehicle.Cabin.Sunroof"` | `Vehicle.Cabin.Sunroof.Position`<br>`Vehicle.Cabin.Sunroof.Shade.Position`<br>`Vehicle.Cabin.Sunroof.Shade.Switch`<br>`Vehicle.Cabin.Sunroof.Switch` |
| `"Vehicle.Cabin.Sunroof.**"` | `Vehicle.Cabin.Sunroof.Position`<br>`Vehicle.Cabin.Sunroof.Shade.Position`<br>`Vehicle.Cabin.Sunroof.Shade.Switch`<br>`Vehicle.Cabin.Sunroof.Switch` |
| `"Vehicle.Cabin.Sunroof.*"` | `Vehicle.Cabin.Sunroof.Position`<br>`Vehicle.Cabin.Sunroof.Switch` |
| `"Vehicle.Cabin.Sunroof.*.Position"` | `Vehicle.Cabin.Sunroof.Shade.Position` |
| `"**.Sunroof.*.Position"` | `Vehicle.Cabin.Sunroof.Shade.Position` |
| `"*.*.*.*.Position"` | `Vehicle.Cabin.Sunroof.Shade.Position` |
| `"Vehicle.Cabin.Sunroof.**.Position"` | `Vehicle.Cabin.Sunroof.Position`<br>`Vehicle.Cabin.Sunroof.Shade.Position` |
| `"**.Sunroof"` | Nothing |
| `"**.Sunroof.**"` | `Vehicle.Cabin.Sunroof.Position`<br>`Vehicle.Cabin.Sunroof.Shade.Position`<br>`Vehicle.Cabin.Sunroof.Shade.Switch`<br>`Vehicle.Cabin.Sunroof.Switch` |
| `"*.Sunroof"` | Nothing|
| `"Sunroof"` | Nothing|