home.social

#pcre — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #pcre, aggregated by home.social.

fetched live
  1. Атомарные регулярные выражения

    Регулярные выражение обладают возможностями отслеживания пройденного пути и рефлексией. Разберемся, как использовать эти возможности для захвата фрагментов текста, как применить к ним цвет и вывести в консоль.

    habr.com/ru/articles/1057658/

    #regex #регулярки #регулярные_выражения #парсинг #pcre #алгоритмы #изучение_программирования #autohotkey #регулярное_выражение #regular_expressions

  2. Did you know #Microslop #Excel supports #PCRE?

    I was trying to extract some strings from a cell (written by one of those people who think that Excel is is just "Word with lines") when I thought "ugh, I wish I could just use a #regex."

    Then I noticed this. Unfortunately, the documentation doesn't explain much, so it took some time to figure out their weirdness; no delimiters, no modifiers, etc. That aside, it does support capture groups, so I was able to extract all the values with a single regex.

    Pretty handy!

  3. Oha, #inotifywait kann keine #PCRE (Negatives Lookahead). Wie kann man dann mit -exclude sinnvoll Dateiendungen ausschließen?

    Muss ich jetzt erst einen Converter entwickeln, um die Kernkonstrukte und Negationen auf POSIX abzubilden??

    inotifywait patchen könnte einfacher sein 🤔

  4. Oha, #inotifywait kann keine #PCRE (Negatives Lookahead). Wie kann man dann mit -exclude sinnvoll Dateiendungen ausschließen?

    Muss ich jetzt erst einen Converter entwickeln, um die Kernkonstrukte und Negationen auf POSIX abzubilden??

    inotifywait patchen könnte einfacher sein 🤔

  5. @dm

    Always. I kinda wish #PCRE (Perl-Compatible Regular Expressions) were more accepted, because some of those shortcuts (particularly \s) are very space-saving compared to their traditional counterparts ([[:space:]]), but since only GNU grep provides a PCRE option (-P), I avoid using it for the sake of greater compatibility.

  6. @dm

    Always. I kinda wish #PCRE (Perl-Compatible Regular Expressions) were more accepted, because some of those shortcuts (particularly \s) are very space-saving compared to their traditional counterparts ([[:space:]]), but since only GNU grep provides a PCRE option (-P), I avoid using it for the sake of greater compatibility.

  7. @christmastree

    Nice! Good old #PCRE.

    FYI, Mastodon doesn't support markdown formatting or longer posts, but Hometown, GlitchSocial (both forks of Mastodon) and GoToSocial and snac (both independent fediverse server implementations) do. :)

  8. @christmastree

    Nice! Good old #PCRE.

    FYI, Mastodon doesn't support markdown formatting or longer posts, but Hometown, GlitchSocial (both forks of Mastodon) and GoToSocial and snac (both independent fediverse server implementations) do. :)

  9. From to powerful in projects and , Philip Hazel’s career is an exciting journey of success and the evolution of ! 🐧

    Dive into Hazel’s story on @LWN and consider carrying on the torch maintaining :

    t.ly/RLY3Q

  10. From #punchcards to powerful #code in #opensource projects #PCRE and #Exim, Philip Hazel’s career is an exciting journey of #FOSS success and the evolution of #tech! 🐧

    Dive into Hazel’s story on @LWN and consider carrying on the torch maintaining #PCRE2:

    t.ly/RLY3Q

    #LPI #LWN #techhistory #freesoftware #softwaredevelopment #github #perl #Linux #Unix #GPL #Apache #MariaDB

  11. How free software hijacked Philip Hazel's life [LWN.net]

    Link
    📌 Summary:
    - Philip Hazel 開始開發 Exim 電子郵件傳送代理(MTA)時 51 歲,後來又開始了 PCRE(Perl-Compatible Regular Expressions)專案,到 80 歲時還在維護 PCRE,以及其後續的 PCRE2。
    - Hazel 在成為自由軟體開發者之前已經開始寫代碼,而非在起步時。
    - 在他的技術回憶錄《從穿孔卡片到平面顯示器》中,Hazel 表示他加入了劍橋計算機服務作為軟體開發人員是因為他了解 Manchester Autocode 語言,該語言與 Titan Autocode 相似,他在那裡開始了滑溜的下坡路。
    - Hazel 還開發了 PCRE,為了 Exim 的靈活正則表示式,而不是使用 Smail 中的 Smail MTA。
    - Hazel 在 1995 年 3 月開始工作在 Experimental Internet Mailer(Exim)中,到 11 月時它已經可以發送和接收郵件了。
    - 在與 Richard Stallman 談過後,他將 Exim 的授權從自定義的授權切換到 GPL。
    - Hazel 開發了 PCRE,現在被廣泛用於各種應用和作業系統中。
    - Hazel 正在尋找 PCRE2 的繼任者,他計劃在需要時繼續維護非 PCRE2 的專案,並幫助 PCRE2。

    🎯 Key Points:
    - Hazel 在 1995 年開始 Exim 專案後的 27 年內一直在維護 Exim 和 PCRE。
    - 他在 2007 年退休時將 Exim 的維護交接給他人。
    - 他希望在仍然能夠幫助過渡時交接 PCRE2。

    🔖 Keywords:
    #Hazel, #Exim, #PCRE, #PCRE2, #GNU, #Linux, #Free Software, #Software Development, #Programming

  12. @AnarchoDoggo @silberfuchs @swaggboi #Perl did not “give” the world #PCRE; Philip Hazel wrote it for the #Exim mail transport agent software in 1997.

    I like to refer to it as “*Partially* Compatible Regular Expressions.” Here is the project’s documentation on (some) areas where it will disappoint you: PCRE.org/current/doc/html/pcre

  13. #BSI WID-SEC-2023-1983: [UPDATE] [mittel] #PCRE (#Perl #Compatible #Regular #Expressions): Schwachstelle ermöglicht Denial of Service

    Ein entfernter, anonymer Angreifer kann eine Schwachstelle in PCRE (Perl Compatible Regular Expressions) ausnutzen, um einen Denial of Service Angriff durchzuführen.

    wid.cert-bund.de/portal/wid/se

  14. #BSI WID-SEC-2023-1983: [UPDATE] [mittel] #PCRE (#Perl #Compatible #Regular #Expressions): Schwachstelle ermöglicht Denial of Service

    Ein entfernter, anonymer Angreifer kann eine Schwachstelle in PCRE (Perl Compatible Regular Expressions) ausnutzen, um einen Denial of Service Angriff durchzuführen.

    wid.cert-bund.de/portal/wid/se

  15. Has anyone ever made GNU COBOL talk to PCRE, or any other regex library? I feel like I'm close to getting it to work with PCRE, but i'm trying to piece together multiple sets of docs, and I’m still feeling a bit lost. I keep saying, “Hmm. I'm surprised that worked" with each step forward. 🤣

    #COBOL #GNU #regex #pcre

  16. Has anyone ever made GNU COBOL talk to PCRE, or any other regex library? I feel like I'm close to getting it to work with PCRE, but i'm trying to piece together multiple sets of docs, and I’m still feeling a bit lost. I keep saying, “Hmm. I'm surprised that worked" with each step forward. 🤣

    #COBOL #GNU #regex #pcre

  17. #regex #question

    I was going through some HTML markup/ content where my <h1>,<hx> tags have no anchors/ ID's. pain in the butt to do that manually if i want anchors, It occurred to me: why don't I just process the markup and use the &#x003C;h1&#x003e; (..contents ...) &#x003C;/h1&#x003e;
    but the (...contents...) atom needs filtering. E.g. "this just in", maybe I want "this_just_in"

    That's not really possible w/ #PCRE is it?

    Maybe this is something #sed can do? Im not super fmlr w/ all gnutils

  18. #regex #question

    I was going through some HTML markup/ content where my <h1>,<hx> tags have no anchors/ ID's. pain in the butt to do that manually if i want anchors, It occurred to me: why don't I just process the markup and use the &#x003C;h1&#x003e; (..contents ...) &#x003C;/h1&#x003e;
    but the (...contents...) atom needs filtering. E.g. "this just in", maybe I want "this_just_in"

    That's not really possible w/ #PCRE is it?

    Maybe this is something #sed can do? Im not super fmlr w/ all gnutils

  19. @barubary @Edent Or #PCRE, the Perl Compatible* Regular Expression engine, Which is used by #PHP and #Rlang as well as the #Apache and #nginx HTTP servers, #nmap, #Postfix, and #Exim (for which it was originally written).

    You can even make your #Perl compatible with PCRE instead of other Perl, but you should have a good reason (performance mostly): metacpan.org/pod/re::engine::P

    * PCRE2’s own documentation highlights nineteen separate significant differences: pcre.org/current/doc/html/pcre

  20. @barubary @Edent Or #PCRE, the Perl Compatible* Regular Expression engine, Which is used by #PHP and #Rlang as well as the #Apache and #nginx HTTP servers, #nmap, #Postfix, and #Exim (for which it was originally written).

    You can even make your #Perl compatible with PCRE instead of other Perl, but you should have a good reason (performance mostly): metacpan.org/pod/re::engine::P

    * PCRE2’s own documentation highlights nineteen separate significant differences: pcre.org/current/doc/html/pcre

  21. @Codely @drupler It helps to build your complicated #RegularExpressions in pieces and store them in separate variables. You can then test them in isolation and not be confused when you concatenate them together for your actual matching.

    Both #PHP and #JavaScript also support named capture groups if you’re doing replacements. They’re a lot more readable.

    Also, PHP’s #PCRE-based engine has a PCRE_EXTENDED flag that lets you add whitespace, newlines, and comments.

    #regexes #regexps

  22. @Codely @drupler It helps to build your complicated #RegularExpressions in pieces and store them in separate variables. You can then test them in isolation and not be confused when you concatenate them together for your actual matching.

    Both #PHP and #JavaScript also support named capture groups if you’re doing replacements. They’re a lot more readable.

    Also, PHP’s #PCRE-based engine has a PCRE_EXTENDED flag that lets you add whitespace, newlines, and comments.

    #regexes #regexps

  23. @thfr

    Good to know I don't have to fetch GNU ls ^___^

    But honestly, not missing it. :D

    Is colorls developed by one of the devs, or is it imported from ?

    The only thing I sometimes miss is the . Even vim seems to be missing it, for some reason.
    Oh, and emoji. Emojis work great in Chromium, but almost nowhere else.

  24. @thfr

    Good to know I don't have to fetch GNU ls ^___^

    But honestly, not missing it. :D

    Is colorls developed by one of the #OpenBSD devs, or is it imported from #FreeBSD?

    The only thing I sometimes miss is the #PCRE. Even vim seems to be missing it, for some reason.
    Oh, and emoji. Emojis work great in Chromium, but almost nowhere else.

  25. I just completed "Tuning Trouble" - Day 6 - Advent of Code 2022 #AdventOfCode in #regex (#pcre #grep) github.com/lucaswiman/advent-o
    adventofcode.com/2022/day/6

    Uses negative lookahead assertions and backreferences to force uniqueness. Then feed it to `grep - Pbo` (P=Perl regexes, b=byte offset, o=only match) to get the position.

  26. @RL_Dane @benjaminhollon @marcxjo #PCRE was “inspired by” #Perl #RegularExpressions. It was developed as a replacement for the original Spencer #regexp library used by the #Exim mail transfer agent. Although there has been some cross-pollination of features, they’re independent projects with different goals.

    #PCRE2 documents some of its differences with Perl here: pcre.org/current/doc/html/pcre

  27. @RL_Dane @benjaminhollon @marcxjo #PCRE was “inspired by” #Perl #RegularExpressions. It was developed as a replacement for the original Spencer #regexp library used by the #Exim mail transfer agent. Although there has been some cross-pollination of features, they’re independent projects with different goals.

    #PCRE2 documents some of its differences with Perl here: pcre.org/current/doc/html/pcre

  28. @mjgardner @benjaminhollon @marcxjo

    I wonder where came from, if not from Perl, then?

  29. @RL_Dane
    #PCRE… isn’t. One of these days I’m going to have to catalog the differences between it and the firepower of a fully armed and operational #Perl #regexp battlestation perldoc.perl.org/perlre

    @benjaminhollon @marcxjo

  30. @benjaminhollon @TheTuzu

    I use bc, but python is good, too.

    I'm tempted to use perl as grep on #OpenBSD for access to yummy #PCRE ^__^

  31. @benjaminhollon @marcxjo

    Regex is really quite decent, but definitely an acquired taste.

    I particularly like #regex in #perl, because #PCRE (Perl-Compatible Regular Expressions) are super powerful, mostly instead of needing to use large character classes like [[:alnum:]], [[:space:]] and [0-9], you can just write \w, \s, and \d, respectively. There's also the massively powerful \b, which represents a word border.

    ...

  32. #Programming #languages I used professionally, or for real/finished personal projects:

    - #Bash
    - #CSharp
    - #CoffeeScript (ugh)
    - #Haskell
    - #Java
    - #JavaScript
    - #Kotlin
    - #Perl
    - #PHP
    - #Python
    - #Ruby
    - #Scala
    - #TypeScript

    DSLs that matter:

    - #HTML, #CSS
    - #PCRE #regexp
    - #SQL
    - #Math 😛

    Others I learned or played with, and that I can probably pick up quickly:

    - #Clojure
    - #CPP
    - #FSharp
    - #OCaml

    I should probably mention my non-native #English 🙂

    Primarily, we're language learners 💪