DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th August 2017
gustaf gustaf is offline
Fdisk Soldier
 
Join Date: Dec 2016
Posts: 68
Default Visual guide to re_format(7)

Hello everyone!

I've finally gotten around to trying regular expressions.

For years, they seemed like magic incantations, accessible only to the initiated. There were too many incomprehensible details and I could never get them to work. It was easier to avoid them altogether and find a different solution to the problem.

This week, I hit a wall and couldn't avoid them anymore. There simply was no other easy solution. I cracked open the re_format(7) man page and decided to draw what I was reading. A diagram of the first few paragraphs emerged, then some tables that would make it easy for me to locate the RE components and their meanings.

The end result is a visual guide to OpenBSD re_format(7). I have posted this guide as a PDF attachment since I can't find a way to make a table with BBcode.

I think I finally have my facts straight about the OpenBSD implementation of regular expressions. If anyone sees any glaring (or not so glaring) inaccuracies, feel free to let me know.
Attached Files
File Type: pdf OBSD-Regular_Expressions.pdf (85.6 KB, 158 views)

Last edited by gustaf; 20th August 2017 at 03:16 PM. Reason: Changed title from 'Regular expressions in OpenBSD'
Reply With Quote
  #2   (View Single Post)  
Old 14th August 2017
gustaf gustaf is offline
Fdisk Soldier
 
Join Date: Dec 2016
Posts: 68
Default

Under the BASIC REGULAR EXPRESSIONS section of the re_format(7) man page, there is a bulleted list of the ways basic regular expressions differ from extended regular expressions, one of which is:

Quote:
'*' is an ordinary character if it appears at the beginning of [a basic] RE or the beginning of a parenthesized subexpression (after a possible leading '^').
I don't see how this is different from the use of '*' in an extended RE.

Last edited by gustaf; 15th October 2017 at 08:04 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell aliases for regular user dbach OpenBSD General 5 30th December 2011 11:41 PM
Regular expressions: renaming files with 'sed' J65nko Guides 26 15th October 2010 08:03 PM
sed(1) support for Extended Regulare Expressions (ERE) J65nko OpenBSD General 0 25th January 2010 05:46 PM
PHP regular expression help cajunman4life Programming 2 16th August 2008 05:17 PM
are you an former bsdforum regular? ephemera Off-Topic 18 28th July 2008 12:57 PM


All times are GMT. The time now is 05:51 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick