We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello! I'm playing a little bit with sd and tried to execute the following:
sd
echo "some text 123" | sd -p 'some text (?<numbers>{3})' '${numbers}'
I expected to get the output 123 but I'm getting
123
Error: invalid regex regex parse error: some text (?<numbers>{3}) ^ error: unrecognized flag
instead. According to this cheatsheet I can use
(?<name>...) | Named Capturing Group
for a named group capturing but it doesn't work for sd. Where can I look up the regex syntax which sd uses?
The text was updated successfully, but these errors were encountered:
Hello,
I just tried this
echo "some text 123" | sd --preview 'some text (?P<numbers>[0-9]{3})' 'with named capture group : ${numbers} ; with counted capture group : $1'
And it outputs this :
with named capture group : 123 ; with counted capture group : 123
Sorry, something went wrong.
sd uses the regex crate
regex
sd/Cargo.toml
Line 15 in ac76b2d
which show examples for named capture group
https://github.com/rust-lang/regex/blob/159a63c85eb77ec321301bc4c4ebfb90343edc2b/README.md?plain=1#L37
Oh god, I just needed the --preview arg.... thank you!
--preview
No branches or pull requests
Hello! I'm playing a little bit with
sd
and tried to execute the following:I expected to get the output
123
but I'm gettinginstead. According to this cheatsheet I can use
for a named group capturing but it doesn't work for
sd
. Where can I look up the regex syntax whichsd
uses?The text was updated successfully, but these errors were encountered: