Project

General

Profile

« Previous | Next » 

Revision 611

simplify_xpath: Be case sensitive to handle VegX correctly

View differences:

bin/simplify_xpath
10 10
        line = sys.stdin.readline()
11 11
        if line == '': break
12 12
        # Forward * abbrs
13
        line = re.sub(r'(?i)(\w+)(?=\w*(?:->/[^/]*)?/\1\b)', r'*', line)
13
        line = re.sub(r'(\w+)(?=\w*(?:->/[^/]*)?/\1\b)', r'*', line)
14 14
        # Backward * abbrs
15
        line = re.sub(r'(?i)((\w+)->/[^/]*/[^/]*\[)\2', r'\1*', line)
15
        line = re.sub(r'((\w+)->/[^/]*/[^/]*\[)\2', r'\1*', line)
16 16
        sys.stdout.write(line)
17 17

  
18 18
main()

Also available in: Unified diff