# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/<Path Fill(?![^<>]*#898989[^<>]*\/>)[^<>]*\/>//gms;t' <<< "<Path Fill=\"None\"
PathData=\"M244.87,363.97 L245.38,363.91 M245.38,363.91 L245.46,363.84 M245.46,363.84 L245.52,363.75 M245.52,363.75 L245.54,363.7 M245.54,363.7 L246.07,370.18 M246.07,370.18 L245.95,370.25 M245.95,370.25 L245.8,370.37 M245.8,370.37 L245.63,370.54 M245.63,370.54 L245.52,370.73 M245.52,370.73 L245.42,370.9 M245.42,370.9 L245.17,368.03 M245.17,368.03 L244.87,363.97\"
Stroke=\"#898989\" StrokeWidth=\"0.5\"/>
<Path Fill=\"None\"
PathData=\"M247.4,371.21 L247.49,371.16 M247.49,371.16 L247.91,371.13 M247.91,371.13 L249.74,371.01 M249.74,371.01 L252.52,370.82 M252.52,370.82 L252.72,370.83 M252.72,370.83 L252.72,370.84 M252.72,370.84 L252.71,370.89 M252.71,370.89 L252.72,370.95 M252.72,370.95 L252.75,371.38 M252.75,371.38 L251.86,371.44 M251.86,371.44 L249.62,371.63 M249.62,371.63 L247.55,371.79 M247.55,371.79 L247.51,371.35 M247.51,371.35 L247.47,371.28 M247.47,371.28 L247.42,371.22 M247.42,371.22 L247.4,371.21\"
Stroke=\"#878787\" StrokeWidth=\"0.5\"/>
<Path Fill=\"None\"
PathData=\"M246.46,372.67 L246.47,372.05 M246.47,372.05 L246.47,372.05 M246.47,372.05 L246.52,372.07 M246.52,372.07 L246.58,372.09 M246.58,372.09 L247.44,372.02 M247.44,372.02 L248.68,371.91 M248.68,371.91 L248.81,373 M248.81,373 L248.07,373.06 M248.07,373.06 L247.88,373.07 M247.88,373.07 L248.54,379.11 M248.54,379.11 L247.62,379.18 M247.62,379.18 L247.2,379.21 M247.2,379.21 L247.15,379.24 M247.15,379.24 L247.12,379.27 M247.12,379.27 L247.06,379.17 M247.06,379.17 L246.83,376.84 M246.83,376.84 L246.46,372.67\"
Stroke=\"#898989\" StrokeWidth=\"0.5\"/>"
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html