Skip to main content

Memoized Regular Expressions

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12803))

Abstract

We extend non-deterministic finite automata (NFAs) and regular expressions (regexes) by adding memoization to these formalisms. These extensions are aimed at improving the matching time of backtracking regex matchers. Additionally, we discuss how to extend the concept of ambiguity in order to be applicable to memoized extensions of regexes and NFAs. These more general notions of ambiguity can be used to analyze the matching time of backtracking regex matchers enhanced with memoization.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. Davis, J.C., Servant, F., Lee, D.: Using selective memoization to defeat regular expression denial of service (ReDoS). In: 2021 IEEE Symposium on Security and Privacy (SP), Los Alamitos, CA, USA, May 2021, pp. 543–559. IEEE Computer Society (2021)

    Google Scholar 

  2. James, D.: On the impact and defeat of regular expression denial of service. Ph.D. thesis, Virginia Polytechnic Institute and State University (2020)

    Google Scholar 

  3. Spencer, H.: A Regular-Expression Matcher, pp. 35–71. Academic Press Professional Inc., USA (1994)

    Google Scholar 

  4. Weideman, N., van der Merwe, B., Berglund, M., Watson, B.: Analyzing matching time behavior of backtracking regular expression matchers by using ambiguity of NFA. In: Han, Y.-S., Salomaa, K. (eds.) CIAA 2016. LNCS, vol. 9705, pp. 322–334. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-40946-7_27

    Chapter  MATH  Google Scholar 

  5. Berglund, M., van der Merwe, B., Watson, B., Weideman, N.: On the semantics of atomic subgroups in practical regular expressions. In: Carayol, A., Nicaud, C. (eds.) CIAA 2017. LNCS, vol. 10329, pp. 14–26. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-60134-2_2

    Chapter  MATH  Google Scholar 

  6. Weber, A., Seidl, H.: On the degree of ambiguity of finite automata. Theoret. Comput. Sci. 88(2), 325–349 (1991)

    Google Scholar 

  7. Allauzen, C., Mohri, M., Rastogi, A.: General algorithms for testing the ambiguity of finite automata. In: Ito, M., Toyama, M. (eds.) DLT 2008. LNCS, vol. 5257, pp. 108–120. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-85780-8_8

    Chapter  Google Scholar 

  8. Brüggemann-Klein, A.: Regular expressions into finite automata. Theor. Comput. Sci. 120(2), 197–213 (1993)

    Google Scholar 

  9. Thompson, K.: Programming techniques: regular expression search algorithm. Commun. ACM 11(6), 419–422 (1968)

    Google Scholar 

  10. Karp, R.M.: Reducibility among combinatorial problems. In: Miller, R., Thatcher, J. (eds.) Complexity of Computer Computations, pp. 85–103. Plenum Press (1972)

    Google Scholar 

  11. Regular expression library. https://regexlib.com/. Accessed 05 Mar 2021

  12. Davis, J.C., Michael IV, L.G., Coghlan, C.A., Servant, F., Lee, D.: Why aren’t regular expressions a Lingua Franca? An empirical study on the re-use and portability of regular expressions. In: Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2019, pp. 443–454 (2019)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Martin Berglund .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

van der Merwe, B., Mouton, J., van Litsenborgh, S., Berglund, M. (2021). Memoized Regular Expressions. In: Maneth, S. (eds) Implementation and Application of Automata. CIAA 2021. Lecture Notes in Computer Science(), vol 12803. Springer, Cham. https://doi.org/10.1007/978-3-030-79121-6_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-79121-6_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-79120-9

  • Online ISBN: 978-3-030-79121-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics