Skip to content

Conversation

@LinuxBoy-96
Copy link
Contributor

@LinuxBoy-96 LinuxBoy-96 commented Jul 26, 2025

I’ve decided that we can drop Regex as a dependency.
In fact, we need very little functionality from it.

This PR introduces regex.rs, a custom implementation to replace the crate, as I believe the risk is negligible.

With this change, the compiled release binary size goes from 3976 KB down to 2440 KB —
a reduction of 1536 KB, or 38.6%.

From my testing, it works flawlessly.

You are very welcome 😎

@ryuichiueda
Copy link
Collaborator

I have also wanted to remove it. I will test your implementation. Thank you!

@ryuichiueda ryuichiueda merged commit 40a1e30 into shellgei:alpha-tmp Jul 26, 2025
@ryuichiueda
Copy link
Collaborator

Oops I found the following difference. (test_compound.bash in https://github.com/shellgei/rusty_bash_test )

bash-5.2$ A=a ; [[ $A =~ a ]] ; echo $?
0
alpha-tmp🌵~/GIT/rusty_bash(debug)🍣 A=abc ; [[ $A =~ a ]] ; echo $?
1

In the test script, errors found in LINE 806, 809, 812, ...

Could you fix them?

Tnank you

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

Successfully merging this pull request may close these issues.

2 participants