편집 기록

편집 기록
  • 프로필 정토드님의 편집
    날짜2018.05.30

    정규표현식 사용할 때 escape에러 질문입니다.


    'A lesson for all of us: "If we do not offer the body and mind a period of rest, retreat, and recovery, our \x93engagement\x94 with the world becomes a form of self-injury, of overload. We don\x92t develop resistance or resilience. '

    이런 문장에서 "\x" 이 부분을 없애고 싶어서 정규식 이용해서

     sentence = re.sub("\\\x", "", sentence)
    

    이렇게 코드를 짰는데

    incomplete escape \x at position 0

    이런 에러가 뜨네요..

    어떻게 해야하나요?

  • 프로필 김한나님의 편집
    날짜2018.05.29

    escape에러 질문입니다.


    'A lesson for all of us: "If we do not offer the body and mind a period of rest, retreat, and recovery, our \x93engagement\x94 with the world becomes a form of self-injury, of overload. We don\x92t develop resistance or resilience. '

    이런 문장에서 "\x" 이 부분을 없애고 싶어서 정규식 이용해서

    sentence = re.sub("\\x", "", sentence)

    이렇게 코드를 짰는데

    incomplete escape \x at position 0

    이런 에러가 뜨네요..

    어떻게 해야하나요?