Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
(?P<kind>(frames_cleanpass)|(disparity)|(optical_flow))/(?P<scene>[^/]+)_x2/(into_(?P<into>\w+)/)?(?P<view>left|right)/([^_]+_)?(?P<ID>\d{4})(_L|R)?\.(?P<ext>(?(2)png|pfm))
"
smg

Description

Parses Monkaa dataset filenames and extracts all the relevant labels

Submitted by IP - 3 years ago