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
OS version: Linux Mint 20.2 Cinnamon Bulky version: 1.7
Steps to reproduce:
1
2
(.*)
\1_
Find
Replace
Name only
1__
2__
The text was updated successfully, but these errors were encountered:
Seems to be the normal behavior of regular expressions.
You can usr (.+) or ^(.*) for the correct result.
Sorry, something went wrong.
But string replace --regex '(.*)' '$1_' 1 produces exactly one underscore instead of two. It uses PCRE2 flavor. 🤔
string replace --regex '(.*)' '$1_' 1
It is because of the way python's re library works.
re
>>> import re >>> re.findall(r'(.*)', 'abcde') ['abcde', '']
The empty string in the result is causing the double underscore. Using (.+) or ^(.*)$ instead of (.*) will fix the issue.
(.+)
^(.*)$
Thanks for the answer! But am not sure whether such behavior is intuitive.
No branches or pull requests
OS version: Linux Mint 20.2 Cinnamon
Bulky version: 1.7
Steps to reproduce:
1
and2
names respectively.(.*)
and\1_
intoFind
andReplace
fields respectively. (Replace mode isName only
)1__
and2__
names respectively.The text was updated successfully, but these errors were encountered: