From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <6dd2c451e1f881509a241b8d99cf1351@quintile.net> References: <6dd2c451e1f881509a241b8d99cf1351@quintile.net> Date: Mon, 20 Aug 2012 15:21:12 +0200 Message-ID: From: Rudolf Sykora To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] sam command language question Topicbox-Message-UUID: ad2c4ae2-ead7-11e9-9d60-3106f5b1d025 On 20 August 2012 14:25, Steve Simon wrote: > I am confused, and appologise to all for the noise. > > ,x/label="[^"]+"/ { > x/ [a-z]/ | tr a-z A-Z > } > > does exactly what I wanted, I don't understand why in my toy tests it > didn't appear to work, probably a typo. > > for the record I was tring to do this: > > label="Hello" > -> > label="Hello" (i.e. unchanged) > > label="Hello world and other planets" > -> > label="Hello World And Other Planets" > > -Steve > You could also use something like the following. It would, compared to your code, also capitalize the very first word in the quotation marks (your Hello, if it were hello). ,x/label="[^"]+"/ .-#0+#7,.+#0-#1 y/ / .-#0,.-#0+#1 | tr a-z A-Z It finds the label="stuff", then limits to stuff, then breaks into words, then capitalizes the first letter of each word. Ruda