regular expressions help please!!!
Posted: Wed Jul 23, 2003 8:00 pm
I have a huge text file that I am trying to arrange the out put in but can't seem to match...
the file looks like this
You have the ([A-Z]{3})-(\d\d\d) as the card number
everything after that \w till end of line is the card name
everything under that until another card name is the cards description...
I tried matching ([A-Z]{3})-(\d\d\d) *? (\w*)[\n|\r]
to grabe the first line and replace is with ><$1-$2|$3|
so i can encase and then remove \n to put in a CVS but it doesnt match anything.
Please help.. and if possable explain it to me so I can learn these damn things better
the file looks like this
Code: Select all
MRD-031 Leghul
You can choose which you attack, monster or a
player. If you attack a player, your opponent can’t
defend - attack goes directly against opponent’s Life
Points.
MRD-032 Ooguchi
You can choose which you attack, monster or a
player. If you attack a player, your opponent can’t
defend - attack goes directly against opponent’s Life
Points.
MRD-033 Leogun
MRD-034 Blast Juggler
Either player’s monsters can be destroyed. They must
be face-up. You can NOT destroy this monster itself
by this card’s effect. If there are less than 3 monster
including this monster, you can not activate this card’s
effect. A player of this card can choose when to
activate its effect.
MRD-035 Jinzo #7
You can choose which you attack, monster oeverything after that \w till end of line is the card name
everything under that until another card name is the cards description...
I tried matching ([A-Z]{3})-(\d\d\d) *? (\w*)[\n|\r]
to grabe the first line and replace is with ><$1-$2|$3|
so i can encase and then remove \n to put in a CVS but it doesnt match anything.
Please help.. and if possable explain it to me so I can learn these damn things better