From owner-freebsd-questions@FreeBSD.ORG Mon Jan 12 15:51:36 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78D7573 for ; Mon, 12 Jan 2015 15:51:36 +0000 (UTC) Received: from dnvrco-oedge-vip.email.rr.com (dnvrco-outbound-snat.email.rr.com [107.14.73.225]) by mx1.freebsd.org (Postfix) with ESMTP id 46A44E37 for ; Mon, 12 Jan 2015 15:51:35 +0000 (UTC) Received: from [204.210.114.114] ([204.210.114.114:24113] helo=localhost.hawaii.res.rr.com) by dnvrco-oedge03 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id DE/5C-03951-4E9E3B45; Mon, 12 Jan 2015 15:36:04 +0000 Received: by localhost.hawaii.res.rr.com (Postfix, from userid 1000) id F185B5CA4; Mon, 12 Jan 2015 05:40:38 -1000 (HST) Date: Mon, 12 Jan 2015 05:40:38 -1000 From: parv@pair.com To: f-q Subject: pkg-info: supplying word boundary in regex Message-ID: <20150112154038.GA41662@holstein.holy.cow> Mail-Followup-To: f-q MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-RR-Connecting-IP: 107.14.64.142:25 X-Authority-Analysis: v=2.1 cv=LcKy61vi c=1 sm=1 tr=0 a=lLOF/jpPrR0dcgWXP1EvZg==:117 a=lLOF/jpPrR0dcgWXP1EvZg==:17 a=ayC55rCoAAAA:8 a=kj9zAlcOel0A:10 a=Ymsr-CWnAAAA:8 a=YNv0rlydsVwA:10 a=p0b__uvxvp4pJSsjlrwA:9 a=CjuIK1q_8ugA:10 X-Cloudmark-Score: 0 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2015 15:51:36 -0000 (Running pkg 1.4.4 on FreeBSD 8-STABLE here.) Could somebody tell me please the syntax for word boundary in regex for pkg-info ... pkg info -x '...' ... ? The pkg-info manual page says ... -x, --regex Treat pkg-name as a regular expression according to the "modern" or "extended" syntax of re_format(7). ... and re_format man page says ... There are two special cases= of bracket expressions: the bracket expressions `[[:<:]]' and `[[:>:]]' match the null string at the beginning and end of a word respectively. A word is defined as a sequence of word characters which is neither preceded nor followed by word characters. A word character is an alnum character (as defined by ctype(3)) or an underscore. ... then specifying a word boundary as "x[[:>:]]" (to match "x" at the end of a "word") causes "Invalid regex" error. For example, to get result only for "tex" (avoiding packages with "text" as string in a package name[0]) ... # pkg info -x 'tex[[:>:]]' pkg: sqlite error while executing iterator in file \ pkgdb_iterator.c:905: Invalid regex Does pkg overstate its support for re_format(7) then? - parv [0] Yes, I realize if a name happens to be "text-tex" I would also get a result & that would be expected. Common case is that packages here have only either "text" or "tex" exclusively in the name. --