Good Afternoon all
And sadly it looks like the afternoon of Perl Monks :(
But anyway, I'm looking for some regex guidance so I hope the gurus stil hang around here. I have a field in a | separated line of data that may contain _P_ or may not. The tool I am using to read it needs two distinct regex, one that will match |MyData_P_Rubbish| and only give me MyData and another regex that would match |YourData| and give me YourData but NOT pick up MyData from the previous example
I have \|(?<DataCapture>[^\|]+)_[P][_\|] That picks up the one with _P_ just fine, but I tried using negative zero width assertions and so to capture those without a _P_ something like \|(?<DataCapture>[^\|]+)(?!_[P]_) but it captures the _P_ too and I have no joy. Is it possible?
Is this possible?
Cheers,
R.
In reply to regex excluding some matches by Random_Walk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |