Article 56ZQQ Howto Find and Replace with RegEx

Howto Find and Replace with RegEx

by
pizzipie
from LinuxQuestions.org on (#56ZQQ)
Hi,
Using Ubuntu 18.04.

Typically in Bluefish Editor, LibreOffice, or Pluma:

I am trying to replace a 10 digit number with a Telephone-Number-like format. (I have a LibreOffice Calc Sheet with about 400 phone no's in 10 digit format)

2025551212 => 201.555.1212

I find the raw number 2025551212 with \d{3}\d{3}\d{4}

Find: \d{3}\d{3}\d{4} or I've tried (\d{3})(\d{3})(\d{4}) or /(\d{3})(\d{3})(\d{4})/

Replace With: ???????????????????????????

to get (\d{3}).(\d{3}).(\d{4})
201 . 555 . 1212

I had an answer to a question similar to this from a LibreOffice Forum and part of the answer I got was:

Quote:
Also you can use Find&Replace whith this options

Find: ([^;]*);(.*) //Robert;Smith
Replace: $2;$1 //Smith;Robert
Regular expresions: ON
Which I have not been able to make work.

Thanks for any help,

Rlatest?d=yIl2AUoC8zA latest?i=JCgXyV3HjTk:WkoSr2qT7II:F7zBnMy latest?i=JCgXyV3HjTk:WkoSr2qT7II:V_sGLiP latest?d=qj6IDK7rITs latest?i=JCgXyV3HjTk:WkoSr2qT7II:gIN9vFwJCgXyV3HjTk
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments