Jerry Preston wrote: > Hi! > > I am trying to breakdown the following: > > Pin 60 contacted, height = -11, counter = 1 > > with > > /(\w+)\s+(\d+)\s+(\w+),\s+(\w+)\s+\=\s+-(\d+),\s+(\w+)\s+=\s+(\d+)/; > > Pin 20 contacted, height = 8, counter = 1 > > > /(\w+)\s+(\d+)\s+(\w+),\s+(\w+)\s+\=\s+(\d+),\s+(\w+)\s+=\s+(\d+)/; > But, I would like to do this in one line of code and $5 (-11,8) as > such and not have break out the '-' on the -11. > > How do I do this? > > Thanks, > > Jerry
change the - to -{0,1} which says you can have 0 or 1 hyphen(minus sign) and either include inside the paren to capture or outside as it is. Wags ;) ********************************************************** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. **************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]