2 things.. first you are missing a closing parenth second you are doing it globally (/g)
s/(.{100})(?: |(\-))/$1$2/; this will now take out a space after the 100th character or keep the - after the 100th character. -----Original Message----- From: M z [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 3:20 PM To: [EMAIL PROTECTED] Subject: backreference question Hello I was wondering if someone could point me in the right direction for the following regex. s/(.{1,100}(?: |(\-))/$1$2\n/g; Please help on the second (?: |\-) I am trying to match either a single space ' ' or a - after 100 other characters and I want to save the - but not the ' ' thereby $2 being undefined if ' ' is found after 100. I'm ok with it being undefined but I'm not sure if the above regex is valid, in fact I don't think it works the way I want but needed to write it like that to express what I wanted done __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]