From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?IkrDqXLDtG1lIE0uIEJlcmdlciI=?= Newsgroups: gmane.emacs.help Subject: Re: regex with [_A-Z] not working as I expect Date: Thu, 10 May 2012 19:13:48 +0200 Message-ID: References: <33763671.post@talk.nabble.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDC67C23E437AB8C6EEA4BAAA" X-Trace: dough.gmane.org 1336670072 5850 80.91.229.3 (10 May 2012 17:14:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 May 2012 17:14:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 10 19:14:30 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SSWwY-0000Tv-TM for geh-help-gnu-emacs@m.gmane.org; Thu, 10 May 2012 19:14:23 +0200 Original-Received: from localhost ([::1]:52681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSWwY-0000KN-6X for geh-help-gnu-emacs@m.gmane.org; Thu, 10 May 2012 13:14:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSWwO-0000KH-C7 for help-gnu-emacs@gnu.org; Thu, 10 May 2012 13:14:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSWwM-0005YQ-Ci for help-gnu-emacs@gnu.org; Thu, 10 May 2012 13:14:11 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSWwM-0005Xy-64 for help-gnu-emacs@gnu.org; Thu, 10 May 2012 13:14:10 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SSWwJ-0000Kn-VY for help-gnu-emacs@gnu.org; Thu, 10 May 2012 19:14:07 +0200 Original-Received: from def92-4-82-224-197-72.fbx.proxad.net ([82.224.197.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 May 2012 19:14:07 +0200 Original-Received: from jeberger by def92-4-82-224-197-72.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 May 2012 19:14:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 46 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: def92-4-82-224-197-72.fbx.proxad.net User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.24) Gecko/20120206 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666 In-Reply-To: <33763671.post@talk.nabble.com> X-Enigmail-Version: 0.96.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84800 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDC67C23E437AB8C6EEA4BAAA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable AngusC wrote: > I expected to be able to do things like this: >=20 > Example text to find > 1, Passed,0,Q_Mitel2_with_hub_Env1,1, > 1, Passed,0,Q_Mitel2_with_hub_Env2,1, > 1, Passed,0,Q_Mitel2_with_hub_Env3,1, >=20 > But if my regex search string is > ^1, Passed,0,[_A-Za-z0-9] >=20 > Then it only finds text up to 1, Passed,0,Q >=20 > How do I get it to find all of text like A_BC_D and A_CCCCCC_S Putting a set of characters between square brackets will only match one character from the set. You can then use the usual repetition operators (?, *, or +) to match more than one character (so in your case, ^1, Passed,0,[_A-Za-z0-9]+ should do what you want). Jerome --=20 mailto:jeberger@free.fr http://jeberger.free.fr Jabber: jeberger@jabber.fr --------------enigDC67C23E437AB8C6EEA4BAAA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAk+r90wACgkQd0kWM4JG3k84PQCdFqnUr/ScjIsx10zf9PIFxKhR sZEAn0UZZ0sU4ydC68gZk2XR/1hpZNPB =rc04 -----END PGP SIGNATURE----- --------------enigDC67C23E437AB8C6EEA4BAAA--