enter image description hereSample text:
Engineering | AB7407 | 007412665 | Jackie Browne | Drawing for
Construction
I need 2 RegEx. One can give me 2nd value after the first pipe AB7407
and second Redex can give me 3rd value after the 2nd pipe 007412665
I tried following but it gives me the sample text back:
^(?<field1>[^|]+),(?<field2>[^|]+),(?<field3>[^|]+),(?<field4>[^|]+),(?<field5>[^|]+)$
Result:
Engineering | AB7407 | 007412665 | Jackie Browne | Drawing for
Construction
Can anyone please suggest what is going on with my Regex.
parts(1)now contains the second chunk of string,parts(2)contains the 3rd. This is VB, but the approach for c# or whatever you’re using is similar.To fix your regex:
If you must have 2 regexes,
matches the second chunk, and
matches the 3rd.