Explanations for Regular Expressions

  • Martin Erwig
  • Rahul Gopinath
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7212)

Abstract

Regular expressions are widely used, but they are inherently hard to understand and (re)use, which is primarily due to the lack of abstraction mechanisms that causes regular expressions to grow large very quickly. The problems with understandability and usability are further compounded by the viscosity, redundancy, and terseness of the notation. As a consequence, many different regular expressions for the same problem are floating around, many of them erroneous, making it quite difficult to find and use the right regular expression for a particular problem. Due to the ubiquitous use of regular expressions, the lack of understandability and usability becomes a serious software engineering problem.

In this paper we present a range of independent, complementary representations that can serve as explanations of regular expressions. We provide methods to compute those representations, and we describe how these methods and the constructed explanations can be employed in a variety of usage scenarios. In addition to aiding understanding, some of the representations can also help identify faults in regular expressions. Our evaluation shows that our methods are widely applicable and can thus have a significant impact in improving the practice of software engineering.

References

  1. 1.
    Blackwell, A.F.: See What You Need: Helping End-users to Build Abstractions. J. Visual Languages and Computing 12(5), 475–499 (2001)CrossRefGoogle Scholar
  2. 2.
    Blackwell, A.F., Green, T.R.: Notational Systems - The Cognitive Dimensions of Notations Framework. In: HCI Models, Theories, and Frameworks: Toward and Interdisciplinary Science, pp. 103–133 (2003)Google Scholar
  3. 3.
    Boroditsky, L.: Metaphoric structuring: understanding time through spatial metaphors. Cognition 75(1), 1–28 (2000)CrossRefGoogle Scholar
  4. 4.
    Bransford, J.D., Johnson, M.K.: Contextual prerequisites for understanding: Some investigations of comprehension and recall. J. Verbal Learning and Verbal Behavior 11(6), 717–726 (1972)CrossRefGoogle Scholar
  5. 5.
    Budiselic, I., Srbljic, S., Popovic, M.: RegExpert: A Tool for Visualization of Regular Expressions. In: EUROCON 2007. The Computer as a Tool, pp. 2387–2389 (2007)Google Scholar
  6. 6.
  7. 7.
    Curcio, F., Robbins, O., Ela, S.S.: The Role of Body Parts and Readiness in Acquisition of Number Conservation. Child Development 42, 1641–1646 (1971)CrossRefGoogle Scholar
  8. 8.
    Derek, M.J.: The New C Standard: An Economic and Cultural Commentary. Addison-Wesley Professional (2003)Google Scholar
  9. 9.
    Erwig, M., Walkingshaw, E.: A Visual Language for Representing and Explaining Strategies in Game Theory. In: IEEE Int. Symp. on Visual Languages and Human-Centric Computing. pp. 101–108 (2008)Google Scholar
  10. 10.
    Erwig, M., Walkingshaw, E.: Visual Explanations of Probabilistic Reasoning. In: IEEE Int. Symp. on Visual Languages and Human-Centric Computing, pp. 23–27 (2009)Google Scholar
  11. 11.
    Friedl, J.: Now you have two problems, http://regex.info/blog/2006-09-15/247
  12. 12.
    Hopcroft, J.E., Motwani, R., Ullman, J.D.: Introduction to Automata Theory, Languages, and Computation, 3rd edn. Addison-Wesley Longman Publishing Co., Inc. (2006)Google Scholar
  13. 13.
    Hosoya, H., Vouillon, J., Pierce, B.C.: Regular Expression Types for XML. In: Proc. of the International Conf. on Functional Programming (ICFP), pp. 11–22 (2000)Google Scholar
  14. 14.
    Hur, J., Schuyler, A.D., States, D.J., Feldman, E.L.: SciMiner: web-based literature mining tool for target identification and functional enrichment analysis. Bioinformatics (Oxford, England) 25(6), 838–840 (2009)CrossRefGoogle Scholar
  15. 15.
    Lockwood, J.W., Moscola, J., Kulig, M., Reddick, D., Brooks, T.: Internet Worm and Virus Protection in Dynamically Reconfigurable Hardware. In: Military and Aerospace Programmable Logic Device (MAPLD), p. 10 (2003)Google Scholar
  16. 16.
    Mahalingam, K., Bagasra, O.: Bioinformatics Tools: Searching for Markers in DNA/RNA Sequences. In: BIOCOMP, pp. 612–615 (2008)Google Scholar
  17. 17.
    Miller, R.C., Myers, B.A.: Lightweight Structured Text Processing. In: USENIX Annual Technical Conf., pp. 131–144 (1999)Google Scholar
  18. 18.
    Nakata, A., Higashino, T., Taniguchi, K.: Protocol synthesis from context-free processes using event structures. In: Int. Conf. on Real-Time Computing Systems and Applications, pp. 173–180 (1998)Google Scholar
  19. 19.
    Pike, R.: Structural Regular Expressions. In: EUUG Spring Conf., pp. 21–28 (1987)Google Scholar
  20. 20.
  21. 21.
    Sanfilippo, L., Voorhis, J.V.: Categorizing Event Sequences Using Regular Expressions. IASSIST Quarterly 21(3), 36–41 (1997)Google Scholar
  22. 22.
    Scaffidi, C., Myers, B., Shaw, M.: Topes: reusable abstractions for validating data. In: Int. Conf. on Software Engineering, pp. 1–10 (2008)Google Scholar
  23. 23.
  24. 24.
    Wondracek, G., Comparetti, P.M., Kruegel, C., Kirda, E.: Automatic Network Protocol Analysis. In: Annual Network and Distributed System Security Symp., NDSS 2008 (2008)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Martin Erwig
    • 1
  • Rahul Gopinath
    • 1
  1. 1.School of EECSOregon State UniversityUSA

Personalised recommendations