File: format_regex.py

package info (click to toggle)
python-rjsmin 1.2.5%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,256 kB
  • sloc: javascript: 8,503; python: 5,315; ansic: 821; sh: 100; makefile: 19
file content (14 lines) | stat: -rwxr-xr-x 251 bytes parent folder | download
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,))