match
match(x, table)Looks up x in table and returns the positions where it has found x
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| x | List[Hashable] | a List with Hashable elements | required |
| table | List[Hashable] | a List with Hashable elements | required |
Returns
| Name | Type | Description |
|---|---|---|
| List[int] | a list with positions where it found x in table |
Examples
>>> from rlike import *
>>> x = [1, 2, 4, 3, 3]
>>> y = [3, 4, 6]
>>> match(x, y)
[None, None, 1, 0, 0]
>>> match(y, x)
[3, 2, None]