why this does not match..?sed -e '/--Updated?[[:space:]]+Date/d' inputfilethis..:--Updated Date: 2013-11-06 15:32:13d? is because sometimes I have Update Date, and sometimes Updated Date.for removal? I have tried with \s too, not working.
Regex not matching
sed;regular expression
you need to use the -r parameter.try usesed -r '/--Updated?[[:space:]]+Date/d' inputfileupdating answerWhen you use sed '/something/d' , every line that match with this will be deleted.-r  - the parameter -r is use extended regular expressions .Inside the expression have 2 regular expressions.[[:space:]] - Match with all whitespace characters, including line breaks? - optional+ - one or more times.SO, the command sed will delete every line that match with --updated and than one or more whitespace character and than Date but because of the ? the character d is optional.like:--Updated Date: 2013-11-06 15:32:13--Updated   Date: 2013-11-06 15:32:13--Updated           Date: 2013-11-06 15:32:13--Update Date: 2013-11-06 15:32:13