views:

431

answers:

2

Is there a relatively quick program out there to accomplish at least the basics of this? Just a few regexes? I'm willing to do some manual conversion, but this is a pretty big set of scripts.

A: 

If what you are asking is converting a few regexs in javascript to Python equivalent, the basics of regular expressions are mostly pretty standard. check out the Python re module doc. See if what you are using is documented. Also of interest to you is this page.

If you are talking about converting javascript code to Python equivalent, the best converter is you. Learn about Python, and then convert them manually. there is nothing else better than the human being. Programming constructs like loops, variables, arrays are pretty common and standard you will recognize instantly how to use them straight away.

ghostdog74
+2  A: 

Hm this is a hardone. the definition of a compiler is translates from a higher level langauge to a lower leval language. eg python to machinecode. or java to javascript (google has a rather famous compiler for this somewhere - tis' what makes google doc easier to make) Python to javascript compileres abound. technically javascript to python would be a decompiler. (afaik)

I found some speculation about a javascript-python converter here: follow the tread through. it mostly speaks of how it wouldn't be too hard to do. i can't find anything , but that doesn't mnean it's no out there. a

Regex is not suitable, regex is suitable only for regular languages. programming languages are not normally regular languages. see this

Oxinabox
Thanks, I guess I will have to do it manually to do it right.