1

I'm having a difficult time with regex expressions. I am trying to create a table for a wiki page.

I have:

{| class="wikitable" border="1"
|+ Printer connectivity troubleshooting
! Serial Number !! IP Address
|-
|G90001 192.168.10.21
|-
|G90002 192.168.10.22
|-
|G90069 192.168.10.19
|-

I need:

{| class="wikitable" border="1"
|+ Printer connectivity troubleshooting
! Serial Number !! IP Address
|-
|G90001 || 192.168.10.21
|-
|G90002 || 192.168.10.22
|-
|G90069 || 192.168.10.19

I was able to get the pipes at the beginning of the line in using find and replace and a macro, but I can't come up with a formula that works in the slightest for the pipes between the items. Thank you so much for the help.

1
  • Are there a lot of items? If it's only three it would probably be faster to just type it out Commented Dec 13, 2013 at 17:49

1 Answer 1

2
(\|G9\d+) (.+)

To replace with

\1 || \2

Or a more generic match (not limiting to starting with G9)

^(\|\w+?) (.+)
Sign up to request clarification or add additional context in comments.

1 Comment

You're my hero! I knew I needed the separate expressions, but I couldn't get it work. I had a space between them, like you do and yours didn't work either just now, so that made me think about what could be wrong. I removed the space between the two and used your expression and it worked great! Thank you!!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.