# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/\b(\d{3})(\d{3})(\d{4})\b/($1) $2-$3/g;t' <<< "reformat several 10-digit numeral strings to telephone number format
Hello. I'm looking for regex to use with LibreOffice Calc find-and-replace function to format 10-digit numbers into telephone number format. Example: reformat
4018286606 to be (401) 828-6606
I tried this:
FIND (\[0-9\]{10})
REPLACE WITH \^(\\(\[0-9\]{3}\\)\\s\[0-9\]{3}-\[0-9\]{4})
Not working.
Using LibreOffice [25.8.4.2](http://25.8.4.2)
Thank you.
"
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