mavericknik has asked for the wisdom of the Perl Monks concerning the following question:
The one with out at the end or with nothing at the end are the output pins that I want to match. So I got to:Pin: U343.IN1 in Pin: U713.INP out Pin: U714.QN
Is there a way to combine these two so that it matches both? I tried using "|" to or them/^[ ]+Pin:[ ]*([^\.]*)\.([^ ]*)$/ --> Matches " Pin: U714.QN" $1 = U714 $2 = QN and /^[ ]+Pin:[ ]*([^\.]*)\.([^ ]*)[ ]out/ --> Matches " Pin: U713.INP out" $1 = U713 $2 = INP
But if the second part of the expression matches, my () come in under $3 and $4. Basically, I want to match :^[ ]+Pin:[ ]*([^\.]*)\.([^ ]*)$|^[ ]+Pin:[ ]*([^\.]*)\.([^ ]*)[ ]out
I'm sure there's some simple way to do this and im over complicating it but I cant figure it out for the life of me. A nudge in the rigth dorection would be greatly appreciated. Thanks!Pin: U713.INP"endofstring or out" With $1 = U713 $2 = INP
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with a regex
by Athanasius (Archbishop) on Jul 24, 2015 at 08:16 UTC | |
by mavericknik (Sexton) on Jul 24, 2015 at 08:26 UTC | |
|
Re: Help with a regex
by choroba (Cardinal) on Jul 24, 2015 at 09:07 UTC | |
|
Re: Help with a regex
by Laurent_R (Canon) on Jul 24, 2015 at 09:02 UTC |