Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Hazram
Wanderer


Joined: 24 May 2005
Posts: 71

PostPosted: Mon Aug 01, 2011 5:49 pm   

[SOLVED] Regex pattern oddity
 
I can't figure out why this regex pattern in an ansi trigger:

^\s*((?:\e[\d{1,2}[mS]|[^\w>]|_|x|O)*)\s*\n\w

won't match this output (pasted from the script debugger showing ansi codes):

Quote:
<ESC>[31m+<ESC>[0m
<ESC>[5S@<ESC>[0;31m+<ESC>[0m
This is plain text


The pattern does work, in general, for similar sets of lines, but not this set, and I'm puzzled. Can anyone spot anything?


Last edited by Hazram on Mon Aug 01, 2011 6:13 pm; edited 1 time in total
Reply with quote
Hazram
Wanderer


Joined: 24 May 2005
Posts: 71

PostPosted: Mon Aug 01, 2011 6:07 pm   
 
Ah, I figured it out -- the ansi code for red in the output uses the optional \e[n1;n2{letter} format, which the pattern doesn't account for.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net