Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace enhancements #26

Open
4 tasks
timotheecour opened this issue Oct 8, 2018 · 0 comments
Open
4 tasks

replace enhancements #26

timotheecour opened this issue Oct 8, 2018 · 0 comments

Comments

@timotheecour
Copy link
Contributor

timotheecour commented Oct 8, 2018

  • detect errors at CT instead of RT if both regex pattern and replace pattern are given at CT
    eg:
    echo "abcfoodef".replace(re"f(o)o", "[$2]") should give a CT error

  • error in replacement pattern should be more useful instead of just invalidFormatString ; in above example could show:
    error in replace pattern "[$2]" at column 2: out of bound error 2: expected values 1 through 1

  • $0 could be supported with meaning of "whole match"

  • other patterns could be used for before match and after match, as in https://dlang.org/phobos/std_regex.html#Replace%20format%20string ; either using D's

$` | part of input preceding the match.
-- | --
$' | part of input following the match.

or perhaps using more explicit / easier to remember names, eg $(pre) $(post)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant