Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotMB to Lobste.rsEnglish · 1 month ago

Platform Support for GNU Extensions to Basic Regular Expressions

www.wezm.net

external-link
message-square
0
link
fedilink
1
external-link

Platform Support for GNU Extensions to Basic Regular Expressions

www.wezm.net

RSS BotMB to Lobste.rsEnglish · 1 month ago
message-square
0
link
fedilink
Recently I was reviewing some shell script a colleague had written: if grep -e '@[^@]\+@' "$DIR/install.sh" ; then I thought the \ before the + was a mistake, and also pointed out that if + was to be used we’d probably need to pass -E for extended regular expression (ERE) support. The colleague replied that \+ in a basic regular expression (BRE) was the same as + in ERE (one or more repetitions). This was news to me! I wanted to know more, so I turned to the FreeBSD re_format(7) man page. Historically this is where most of my knowledge about the distinction between BREs and EREs came from. There was no mention of it there. I spun up a FreeBSD virtual machine and performed a quick test, which confirmed that \+ did in fact work.

Comments

alert-triangle
You must log in or # to comment.

Lobste.rs

lobsters

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !lobsters@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

RSS Feed of lobste.rs

Source of the RSS Bot

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 31 users / day
  • 128 users / week
  • 401 users / month
  • 1.69K users / 6 months
  • 2 local subscribers
  • 391 subscribers
  • 15.3K Posts
  • 1.06K Comments
  • Modlog
  • mods:
  • patrick
  • RSS Bot
  • BE: 0.19.15
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org