| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
Surprisingly , gnu sed --help doesn't showup the "-E" option while it does take it sed -E "..." without any errors.
BTW, the "-r" option is supposed to be doing this.
This definitely calls for an update of the GNU sed help options.
---In [email protected], <cs@...> wrote :
On 14Nov2016 14:09, Michelle Konzack <linux4michelle@... mailto:linux4michelle@...> wrote:
>> The string has 4 parameters, deperated by the | sign and I like to get
>> it with something like
>>
>> echo "${RETVAL}" |sed 's!(.*)|(.*)|(.*)!$1!'
>
>This is now working with:
>
> echo "${RETVAL}" |sed 's!\(.*\)|\(.*\)|\(.*\)!\1!'
By default sed uses Basic Regular Expressions, where \( and \) and needed for
grouping. Some seds (eg GNU sed) accept a -E option to enable Extended Regular
Expressions, where ( and ) are the syntax (and various other extra things
work).
Cheers,
Cameron Simpson <cs@... mailto:cs@...>
[Non-text portions of this message have been removed]