Discussion:
RFE: upgrade 'sed' RE's to include perlre syntax.
(too old to reply)
Linda A. Walsh
2014-07-22 08:24:44 UTC
Permalink
Both simple atoms such as "\d" for [0-9] or "\S" for non-space characters
are supported in awk and have been added to grep with the -P switch.

Would it be possible to add a -P type switch to 'sed' so that
pcre compat RE's could be used?
Paolo Bonzini
2014-07-24 14:44:31 UTC
Permalink
Post by Linda A. Walsh
Both simple atoms such as "\d" for [0-9] or "\S" for non-space characters
are supported in awk and have been added to grep with the -P switch.
Would it be possible to add a -P type switch to 'sed' so that
pcre compat RE's could be used?
Yes, indeed part of the work is already done and part of the GNU sed
tarball (search for REG_PERL). Though the option was -R, not -P.

Paolo
Jose E. Marchesi
2014-07-24 16:39:07 UTC
Permalink
Post by Linda A. Walsh
Both simple atoms such as "\d" for [0-9] or "\S" for non-space characters
are supported in awk and have been added to grep with the -P switch.
Would it be possible to add a -P type switch to 'sed' so that
pcre compat RE's could be used?
Yes, indeed part of the work is already done and part of the GNU sed
tarball (search for REG_PERL). Though the option was -R, not -P.

I want to release a new version of sed this August (it is time!) and I
would love to include this functionality on it. I think it is not too
late to use -P instead of -R, to keep some uniformity with the other
tools.
Paolo Bonzini
2014-07-24 16:35:53 UTC
Permalink
Post by Paolo Bonzini
Post by Linda A. Walsh
Both simple atoms such as "\d" for [0-9] or "\S" for non-space characters
are supported in awk and have been added to grep with the -P switch.
Would it be possible to add a -P type switch to 'sed' so that
pcre compat RE's could be used?
Yes, indeed part of the work is already done and part of the GNU sed
tarball (search for REG_PERL). Though the option was -R, not -P.
I want to release a new version of sed this August (it is time!) and I
would love to include this functionality on it. I think it is not too
late to use -P instead of -R, to keep some uniformity with the other
tools.
I can try... :)

Jose, in the meanwhile can you update gnulib in the sed repository?

Paolo
Jose E. Marchesi
2014-07-24 16:52:03 UTC
Permalink
Post by Paolo Bonzini
Post by Linda A. Walsh
Both simple atoms such as "\d" for [0-9] or "\S" for non-space characters
are supported in awk and have been added to grep with the -P switch.
Would it be possible to add a -P type switch to 'sed' so that
pcre compat RE's could be used?
Yes, indeed part of the work is already done and part of the GNU sed
tarball (search for REG_PERL). Though the option was -R, not -P.
I want to release a new version of sed this August (it is time!) and I
would love to include this functionality on it. I think it is not too
late to use -P instead of -R, to keep some uniformity with the other
tools.
I can try... :)

Jose, in the meanwhile can you update gnulib in the sed repository?

Done.
Linda A. Walsh
2014-07-25 02:29:50 UTC
Permalink
Post by Paolo Bonzini
Yes, indeed part of the work is already done and part of the GNU sed
tarball (search for REG_PERL). Though the option was -R, not -P.
I want to release a new version of sed this August (it is time!) and I
would love to include this functionality on it. I think it is not too
late to use -P instead of -R, to keep some uniformity with the other
tools.
Awesome. I don't have a heavy preference on -R v. -P, but trying to
keep similar
function switches the same between tools would be a bonus.

It is REALLY a headache remember what the switch is to specify the
"delimiter"
char in sort, vs. cut, et al...I seem to always pick the wrong one.
Loading...