|
Grumpy Beginner
Joined: 24 May 2004 Posts: 10
|
Posted: Sat Apr 22, 2006 11:16 pm
Regex help. |
I'm trying to match a line which looks something like this:
[ Ogre ] <PK> [KNIGHT] Thandaeus Grogellehorn the Vengeance of the Forest
[ Elf ] <PK> (Outcast) (Wanted) Camthalion Miriel the Holy Patriarch of Healing
Here is my Regex Expression:
<PK> (?:[\a*])? (?:\(\a*\))* (\a*)
I'm trying to capture the name of the characters. But for some reason the optional match * and ? does not work and Zmud does not match unless both [word] and (word) is present on the same line. Does anyone know the reason for this? |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sun Apr 23, 2006 2:28 am |
Try this
Code: |
<PK> (?:\(\a*\) )*(?:\[\a*\] )*(\a*) |
|
|
_________________ Asati di tempari! |
|
|
|
Grumpy Beginner
Joined: 24 May 2004 Posts: 10
|
Posted: Sun Apr 23, 2006 2:44 am |
Thanks, that worked.
|
|
|
|
|
|