File: format_regex.py

package info (click to toggle)
python-rjsmin 1.1.0%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,952 kB
  • sloc: python: 2,515; ansic: 735; sh: 62; makefile: 19
file content (14 lines) | stat: -rwxr-xr-x 251 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python
from __future__ import print_function

import sys

a = sys.argv[1]

while len(a) > 62:
    b, a = a[:62], a[62:]
    while b.endswith('\\'):
        b = b[:-1]
        a = '\\' + a
    print("r'%s'" % (b,))
print("r'%s'" % (a,))