Get string between slash character

diego gutierrez 161 Reputation points
2021-12-27T15:37:44.29+00:00

Hi everyone.

How can I get the highlighted text 22DEC21, I mean the fourth text between slashes with regular expressions?.

PAX 134-4081897261/DTAV/COP65000/22DEC21/BOGAV08LK/76997561

Thanks in advance.

Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 122.6K Reputation points
    2021-12-27T16:10:04.643+00:00

    One of solutions:

    string text = "PAX 134-4081897261/DTAV/COP65000/22DEC21/BOGAV08LK/76997561";
    string result = Regex.Match( text, @"(?<=^([^/]*/){3})([^/]*)" ).Value;
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.