Skip to main content

Can Regular Expressions Be Safely Reused Across Languages?

That is, can I reuse a regular expression crafted in JavaScript verbatim in Python? In doing so, will I get the same results and performance? Enter your languages of interest in place of JavaScript and Python, the question remains the same. 
It is a not well kept secret that programmers are huge fans of copying and pasting code snippets, regular expressions included, that are freely available across the web. But unlike copying and pasting code within the boundaries of the same programming language, does copying a regular expression that was crafted in one language into another work as assumed, or would it introduce errors, both semantically and in performance?
"Why Aren’t Regular Expressions a Lingua Franca? An Empirical Study on the Re-use and Portability of Regular Expressions" is a paper that attempts to shed light on the question: are regular expressions truly portable?

Comments

Popular posts from this blog

Spatial Data Management For GIS and Data Scientists

  Videos of the lectures taught in Fall 2023 at the University of Tennessee are now available as a YouTube playlist. They provide a complete overview of the concepts of GeoSpatial science using Google Earth Engine, PostgresSQL GIS , DuckDB, Python and SQL. https://www.i-programmer.info/news/145-mapping-a-gis/16772-spatial-data-management-for-gis-and-data-scientists.html

Microsoft Goes All Out On Educating Developers

  What better way to lure devs into the platform than to provide clear how-to instructions and deep educational material? Over the last couple of years, but especially during 2023, Microsoft has pumped up its educational facilities on . NET. For instance, it has released a number of self-paced projects we here at I Programmer have covered, such as: https://www.i-programmer.info/news/89-net/16857-microsoft-goes-all-out-on-educating-developers.html