Is pattern `^-0+([0-9]+)` the same as `^-0+([1-9]+)`?
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
Jeff wrote at errors in parameter expansion on filenames named after negative numbers
My best direction at this point is to do something like
[[ $b =~ ^-0+([0-9]+)$ ]] && b=-$BASH_REMATCH[1]
to strip leading zeroes from possibly-negative numbers
I was wondering if the starting digit 0
in the pattern is necessary.
In other words, is pattern ^-0+([0-9]+)
the same as ^-0+([1-9]+)
? Thanks.
bash regular-expression
add a comment |Â
up vote
-1
down vote
favorite
Jeff wrote at errors in parameter expansion on filenames named after negative numbers
My best direction at this point is to do something like
[[ $b =~ ^-0+([0-9]+)$ ]] && b=-$BASH_REMATCH[1]
to strip leading zeroes from possibly-negative numbers
I was wondering if the starting digit 0
in the pattern is necessary.
In other words, is pattern ^-0+([0-9]+)
the same as ^-0+([1-9]+)
? Thanks.
bash regular-expression
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
Jeff wrote at errors in parameter expansion on filenames named after negative numbers
My best direction at this point is to do something like
[[ $b =~ ^-0+([0-9]+)$ ]] && b=-$BASH_REMATCH[1]
to strip leading zeroes from possibly-negative numbers
I was wondering if the starting digit 0
in the pattern is necessary.
In other words, is pattern ^-0+([0-9]+)
the same as ^-0+([1-9]+)
? Thanks.
bash regular-expression
Jeff wrote at errors in parameter expansion on filenames named after negative numbers
My best direction at this point is to do something like
[[ $b =~ ^-0+([0-9]+)$ ]] && b=-$BASH_REMATCH[1]
to strip leading zeroes from possibly-negative numbers
I was wondering if the starting digit 0
in the pattern is necessary.
In other words, is pattern ^-0+([0-9]+)
the same as ^-0+([1-9]+)
? Thanks.
bash regular-expression
bash regular-expression
asked 5 mins ago
Tim
24.6k69239427
24.6k69239427
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479986%2fis-pattern-00-9-the-same-as-01-9%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password