Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool to convert regex between different language syntaxes?

Is there a tool to convert a regex from one popular language's syntax to another? For example a Python-style regex to a Java-style regex?.

Or at least, has someone put together a set of rules to do these conversions?

And obviously some constructs won't be able to convert.

like image 356
guidoism Avatar asked Aug 03 '11 22:08

guidoism


People also ask

Which tool is used for compiling regular expressions?

grep. The name grep is derived from the g/re/p command that performed a regular expression search in the Unix text editor ed, one of the first applications to support regular expressions.

Is regex the same in all languages?

Regular expression synax varies slightly between languages but for the most part the details are the same. Some regex implementations support slightly different variations on how they process as well as what certain special character sequences mean.

Which language is best for regex?

Definitely C++ and Python. Both languages ​​are used together at the same time. C++ to do the work in the framework and Python to command the framework. Yes, Python is not the main language, the main language is C++.

Is regex a scripting language?

Regular Expressions are a particular kind of formal grammar used to parse strings and other textual information that are known as "Regular Languages" in formal language theory. They are not a programming language as such.


2 Answers

Go to this article, and follow the link to "Regex info's comparison of Regex flavors", that got me to a tool called RegexBuddy, which sounds like it might do what you want.

like image 150
John Gaines Jr. Avatar answered Oct 11 '22 05:10

John Gaines Jr.


Yes there is a Windows tool that will do this: RegexBuddy

like image 35
ridgerunner Avatar answered Oct 11 '22 05:10

ridgerunner