Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= Newsgroups: gnu.bash.bug Subject: Re: How anchor to line end in regex Date: Sat, 22 Aug 2020 22:40:48 -0400 Lines: 19 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1598150455 15136 209.51.188.17 (23 Aug 2020 02:40:55 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: Budi Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=larryv.me; h= from:message-id:content-type:mime-version:subject:date :in-reply-to:cc:to:references; s=fm1; bh=D3JBMib9zBUkaGEx7Ta6+/+ 5eXOWF8RNn+u3ZmxfqZ4=; b=jDTPd5urRJG8YxEvDjo1OfC36krR9C6BCmksR3u LLZgAm/CzBEe2cgOXlPY3Ebv9inorIMBT8Xx77GzX1Zgk4zeemrLu7r/UJEn/R+b RJhRQMJpH1vtFPwoJxY8fK1fHj4aXGFRhHmkARN9XTOpjMmGSIhA3EPxwNwDrkyN /1JOmgfTiNMJ1Qx9kBmsWksATYoy4gIiBj74CUcaWF99FokfMI5YdC9dVG1CcZYQ 5xVi8TtPWGoTcVl8uU034wHIr4Cs1AFMqeDFxbtP8RRDsp5nVJzGtJVYEKt9h08X df1f7foiGCKw+K/1HqxgLjh8vb10Xb/maet75zG9PrHRmSA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=D3JBMi b9zBUkaGEx7Ta6+/+5eXOWF8RNn+u3ZmxfqZ4=; b=bt4+eGheBf7qj4eyKplRmM L1gXk+IkhJACpPhikR8ZQgQQ1Z2H7msDyUCw5vIy9UgiA4lW4dRLjZufsXSPTKVd iVyxopX/0XFHYbWwQH8bsgfR4hNhMBbOGUDQgEpgFdjvtZMFpxyy3i5aLbFcyLUy 2N2l9O4150Vy2rPTkY/D2v36O9FikvHb/B9UHjgou+iT0Y+ZKomWUaxO9dQEbzc6 E8Dabjvme6KGqASGInmykGUoo560D7KUh6rju8tOdQfKn4odGKltWWf7zkhFyiwJ swA2bBnq1AwP9wmEnd7Q2RY03HMKUOhpw7fCLW+XnSA+5QV6B9+oDkFgURZoSwRw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudduhedgieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhkfgtggfuffgjvfhfofesrgdtmh erhhdtvdenucfhrhhomhepnfgrfihrvghntggvpgggvghljoiiqhhuvgiiuceovhhqsehl rghrrhihvhdrmhgvqeenucggtffrrghtthgvrhhnpeefvdelheetheekveehtdejvdelge dvhfektedtjefhkedugeefkeehffekvefggfenucfkphepuddttddruddvrddujeekrddv feenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehvqh eslhgrrhhrhihvrdhmvg X-ME-Proxy: In-Reply-To: X-Mailer: Apple Mail (2.3445.104.15) Received-SPF: pass client-ip=66.111.4.28; envelope-from=vq@larryv.me; helo=out4-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/22 22:40:49 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com gnu.bash.bug:16793 Hi, > On Aug 22, 2020, at 10:13 PM, Budi wrote: > > How anchor to line end in bash regex [[ ]] > h=hi > [[ $h =~ ^hi\$ ]] && echo Yes > > cannot work, or is it bug yet Special characters are matched literally if they are quoted, so you just have to make sure the $ is not quoted. $ h=hi $ [[ $h =~ ^hi\$ ]] && echo Yes $ [[ $h =~ ^hi$ ]] && echo Yes Yes vq