Regular expressions in Groovy by example

Поделиться
HTML-код
  • Опубликовано: 31 янв 2025

Комментарии • 12

  • @szymonstepniak
    @szymonstepniak  4 года назад

    Timestamps:
    00:00 Introduction
    00:50 Groovy's find operator with multiple variables assignment
    02:34 Extracting all values matching regular expression from a string
    04:46 Using String.replaceFirst with pattern and closure
    08:18 Thanks for watching the video!

  • @MotoBoyarin
    @MotoBoyarin 5 лет назад +2

    Great video! These features of Groovy helped to implement a HUGE banking project in a fraction of cost. There is a lot more than just random usefulness in these features, it's the wisdom and experience of its authors. Thank you for the video, and keep up the good job of communicating how awesome is Groovy to the world.

    • @szymonstepniakguitar
      @szymonstepniakguitar 5 лет назад +1

      Thank you for the kind words! Any kind of feedback is always welcome and motivates me to keep doing things for the community. Thanks!

  • @АлександраВоробьёва-ч1р

    Thanks for your work!😀

    • @szymonstepniak
      @szymonstepniak  Год назад

      Thank you for your kind words! Take care, and have a good day!

  • @gandatrowx
    @gandatrowx 3 года назад +1

    Your videos are great. You actually calm me down and help me approach coding hurdles with mental ease. Thank you!

    • @szymonstepniak
      @szymonstepniak  3 года назад

      Thank you for your kind words, Lukas! It's so good to hear this video helped you. Take care, and have a good day!

  • @anilshrestha8624
    @anilshrestha8624 4 года назад +1

    how to find and replace comma inside double quoted line using groovy regexp.
    inputline = 1, abc, "23,156,185.50", 55X
    outputline should be : [1, abc, 23156185.50, 55X]

    • @szymonstepniak
      @szymonstepniak  4 года назад

      Hi, Anil! Can you share a working example, please? The sample you've shown does not make much sense, e.g. I don't know what the type of inputline is, I don;t know if this is a string or a list. Create a gist (gist.github.com) with a working example and I will be more than happy to help you with coming up with the final solution. Thanks in advance, and have a good day!

    • @anilshrestha8624
      @anilshrestha8624 4 года назад

      @@szymonstepniak Thank you for quick response. Please find the gist link here: gist.github.com/Anilkumar-Shrestha/51ae9d1ce63821137108168d0cb7b988

    • @szymonstepniak
      @szymonstepniak  4 года назад

      @@anilshrestha8624 You can try something like this: gist.github.com/wololock/aedaf16cf58357ac3933a04932e1428f This regex used with the `String.split()` method splits the string on a coma character that is not a part of the double-quoted string. I hope it helps :)

    • @anilshrestha8624
      @anilshrestha8624 4 года назад +1

      @@szymonstepniak Thank you it worked out. Kudos