Something like that? Found on the internet this construction for raised rules:
\documentclass[a4paper]{article}
\usepackage[explicit]{titlesec}
% Raised Rule Command:
% Arg 1 (Optional) - How high to raise the rule
% Arg 2 - Thickness of the rule
\newcommand{\raisedrulefill}[2][0ex]{\leaders\hbox{\rule[#1]{1pt}{#2}}\hfill}
\titleformat{\section}{\Large\bfseries}{\thesection. }{0em}{#1\,\raisedrulefill[0.4ex]{2pt}}
\pagestyle{plain}
\begin{document}
\section{A short title}
This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.
\section{Another purposely very long title that extends on more than one line}
This is another paragraph.This is another paragraph.This is another paragraph.This is another paragraph.This is another paragraph.This is another paragraph.This is another paragraph.This is another paragraph.
\end{document}