A RegEx question
From: Ian Marlier (marlieri_at_studentuniverse.com)
Date: 07/26/04
- Next message: Jupiterhost.Net: "Re: A RegEx question"
- Previous message: Jerry M. Howell II: "a sed equivelent"
- Next in thread: Jupiterhost.Net: "Re: A RegEx question"
- Reply: Jupiterhost.Net: "Re: A RegEx question"
- Reply: Gunnar Hjalmarsson: "Re: A RegEx question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 26 Jul 2004 07:56:52 -0400 To: <beginners@perl.org>
Hi, all --
I'm in the process of writing a script to migrate from one wiki package to
another.
The old wiki help articles in a series of flat text files. The new one
holds everything in MySQL, so I need to parse the text files into a single
SQL import script. I've got most of it, but there's one place where I'm
getting stuck and could use some help.
The old wiki holds links in one of these formats:
[WikiLink]
Or
[Text That Links|WikiLink]
Or
[Text That Links|http://someurl.com/]
The new one holds them in the form
((WikiLink))
Or
((WikiLink|Text That Links))
Or
((http://someurl.com/|Text That Links))
Replacing the individual characters is easy.
But how can I grab the "link" and "text" parts out (IF there is a "|" in the
middle), and reverse them?
Any help appreciated.
Thanks,
Ian
- Next message: Jupiterhost.Net: "Re: A RegEx question"
- Previous message: Jerry M. Howell II: "a sed equivelent"
- Next in thread: Jupiterhost.Net: "Re: A RegEx question"
- Reply: Jupiterhost.Net: "Re: A RegEx question"
- Reply: Gunnar Hjalmarsson: "Re: A RegEx question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|