|
2009-07-13
| ||
| 19:42 | • Ticket [1822052fff] regexp feature to specify a default value for subMatchVar... artifact: 4b667ccdb0 user: dkf | |
|
2007-10-29
| ||
| 11:46 | • New ticket [1822052fff]. artifact: 410df2c1d1 user: meliorator | |
regexp feature to specify a default value for subMatchVar's
Open1822052fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 17 years ago
Descriptionplain2007-10-29 11:46:12
When matching with an expression that has optional parenthesized subexpressions, it would be useful if a value for the relevant subMatchVar could be set, in the eventuality that the subexpression was not matched.
Example:
regexp {(foo)(bar)?} foobar matchVar subMatchVar1 {subMatchVar2 bar}
This would set the value of subMatchVar2 to bar, whether it matched it or not. It is a rather basic example of the feature that I would like to use in much more complex expressions.
dkfplain2009-07-13 19:42:15
Right now, it's hard-coded to use the empty string. If you need that much control, it might be easier to use the -indices mode instead.
Log in (anonymous is fine) to add a comment.