On Thu, 2011-04-21 at 16:08 -0800, Kevin Miller wrote:
> Karsten Bräckelmann wrote:
> > That should do the trick indeed.
> > 
> > After this, I strongly suggest to carefully re-read the entire
> > thread, and read some docs specifically about the points raised. That
> > includes RE peculiarities [1] you used with previous REs without
> > knowing them, as well as my escaping notes with using the shell.   

> Again, thanks very much to all that chimed in.  Lots to digest here,
> and I'm sure I'll still miss some of the finer points, but having a
> real problem to solve is the best way to actually learn this stuff.

True. But don't stop at understanding why the resulting rule works.
Instead, try to understand why and where each and every previous attempt
(avoiding the term RE here) failed.

Of course, I am particularly back at the different levels of escaping.
Think shell. It adds an additional level of interpretation and thus
escaping. Basics, that really can bite your ass. Classic example:

  find . -name '*.pdf'

*Without* the quotes, *.pdf will be expanded by the shell, IFF there are
PDF files in the dir. If there are none, it just works as expected.

If there are, however, the shell will expand the wildcard. Either
leading to an error (here, with more than one PDF file), or silently
ignoring anything that is not named exactly as the one PDF file in the
current dir...

Multiple levels of escaping. As shown in your OP.


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}

Reply via email to