r"""Get the list of valid names in the expression. Parameters ---------- expr : str A valid expression conforming to the Variable Definition Language. Returns ------- vlist : list List of valid variable names.
(expr)
| 219 | # |
| 220 | |
| 221 | def allvars(expr): |
| 222 | r"""Get the list of valid names in the expression. |
| 223 | |
| 224 | Parameters |
| 225 | ---------- |
| 226 | expr : str |
| 227 | A valid expression conforming to the Variable Definition Language. |
| 228 | |
| 229 | Returns |
| 230 | ------- |
| 231 | vlist : list |
| 232 | List of valid variable names. |
| 233 | |
| 234 | """ |
| 235 | regex = re.compile('\w+') |
| 236 | items = regex.findall(expr) |
| 237 | vlist = [] |
| 238 | for item in items: |
| 239 | if valid_name(item): |
| 240 | vlist.append(item) |
| 241 | return vlist |
| 242 | |
| 243 | |
| 244 | # |