Solved Create two Python capture groups using a line of text

November 10, 2020 at 07:17:53
Specs: AIX 5.3, 4 CPU / 32 GB RAM
Hello,

What is the easiest way to create 2 capture groups for this line of text:

[20/03/2011 10:38:456 UTC] Rest of the line

Expected results:
Capture group 1: [20/03/2011 10:38:456 UTC]
Capture group 2: Rest of the line

Thank you in advance.


See More: Create two Python capture groups using a line of text


#1
November 11, 2020 at 11:27:23
use the below
cp file1 file2

Reply ↓  Report •

#2
November 12, 2020 at 00:58:21
✔ Best Answer
This is a line of text...

textLine = "[20/03/2011 10:38:456 UTC] Rest of the line"

The idea is use a regex to break it into 2 variables:

var1 = "[20/03/2011 10:38:456 UTC]"
var2 = "Rest of the line"


Reply ↓  Report •
Related Solutions


Ask Question