match_arg
match_arg(arg, choices)Match an argument to an existing set of possible values
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| arg | str | a string | required |
| choices | List[str] | a List with strings | required |
Returns
| Name | Type | Description |
|---|---|---|
| str | a str with the first match of arg in choices or a ValueError if not found |
Examples
>>> from rlike import *
>>> match_arg('y', ['x', 'y', 'z'])
'y'