define easily a regexoption #23

Closed
opened 2024-07-05 19:24:43 +02:00 by gnunux · 0 comments
Contributor

Add a new variable regexp type.

For example:

---
version: 1.1
var:
  type: regexp
  regexp: "^[A-Z0-9]*$"

Will generate a new Tiramisu option:

class RegexpOption0(RegexpOption):
    __slots__ = tuple()
    _regexp = re.compile(r'^[A-Z0-9]*$"')
    _type = 'var'

And will use it for this variable.

---
version: 1.1
var1:
  type: regexp
  regexp: "^[A-Z0-9]*$"
var2:
  type: regexp
  regexp: "^[A-Z0-9]*$"

Should only create a simple "RegexpOption".

Add a new variable regexp type. For example: ``` --- version: 1.1 var: type: regexp regexp: "^[A-Z0-9]*$" ``` Will generate a new Tiramisu option: ``` class RegexpOption0(RegexpOption): __slots__ = tuple() _regexp = re.compile(r'^[A-Z0-9]*$"') _type = 'var' ``` And will use it for this variable. ``` --- version: 1.1 var1: type: regexp regexp: "^[A-Z0-9]*$" var2: type: regexp regexp: "^[A-Z0-9]*$" ``` Should only create a simple "RegexpOption".
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: stove/rougail#23
No description provided.