Hello,
I am brand new to python. I have done this in Java.. but struggling to find the right regex in python. Can someone help please?
I need python code to replace " " with "\\ “, for the values coming after surName: and givenName:.
Some of the sample inputs are given below…
“surName: JOHN DOE JR || givenName: JAMES DOE SR”
“givenName: JAMES DOE SR || surName: JOHN DOE JR”
“surName: JOHN DOE JR && givenName: JAMES DOE SR”
“givenName: JAMES DOE SR && surName: JOHN DOE JR”
“surName: JOHN DOE || givenName: JAMES DOE”
“givenName: JAMES DOE SR || surName: JOHN DOE”
“surName: JOHN DOE && givenName: JAMES DOE SR”
Corresponding output should be..
“surName: JOHN\\ DOE\\ JR || givenName: JAMES\\ DOE\\ SR”
“givenName: JAMES\\ DOE\\ SR || surName: JOHN\\ DOE\\ JR”
“surName: JOHN\\ DOE\\ JR && givenName: JAMES\\ DOE\\ SR”
“givenName: JAMES\\ DOE\\ SR && surName: JOHN\\ DOE\\ JR”
“surName: JOHN\\ DOE || givenName: JAMES\\ DOE”
“givenName: JAMES\\ DOE\\ SR || surName: JOHN\\ DOE”
“surName: JOHN\\ DOE && givenName: JAMES\\ DOE\\ SR”
I am brand new to python. I have done this in Java.. but struggling to find the right regex in python. Can someone help please?
I need python code to replace " " with "\\ “, for the values coming after surName: and givenName:.
Some of the sample inputs are given below…
“surName: JOHN DOE JR || givenName: JAMES DOE SR”
“givenName: JAMES DOE SR || surName: JOHN DOE JR”
“surName: JOHN DOE JR && givenName: JAMES DOE SR”
“givenName: JAMES DOE SR && surName: JOHN DOE JR”
“surName: JOHN DOE || givenName: JAMES DOE”
“givenName: JAMES DOE SR || surName: JOHN DOE”
“surName: JOHN DOE && givenName: JAMES DOE SR”
Corresponding output should be..
“surName: JOHN\\ DOE\\ JR || givenName: JAMES\\ DOE\\ SR”
“givenName: JAMES\\ DOE\\ SR || surName: JOHN\\ DOE\\ JR”
“surName: JOHN\\ DOE\\ JR && givenName: JAMES\\ DOE\\ SR”
“givenName: JAMES\\ DOE\\ SR && surName: JOHN\\ DOE\\ JR”
“surName: JOHN\\ DOE || givenName: JAMES\\ DOE”
“givenName: JAMES\\ DOE\\ SR || surName: JOHN\\ DOE”
“surName: JOHN\\ DOE && givenName: JAMES\\ DOE\\ SR”