Hello,

2010/4/11 Chris Watkins <[email protected]>:
> This is as more about the learning process than the actual task... but I
> can't see what's wrong with my regex, and I'd appreciate any pointers.
>
> I want to find cases where a header is not followed by a line break, e.g.
>
> "== External links ==;http://www.americanbamboo.org/GeneralInfo.html
>
> I tried various regex strings, including   "([\r\n]==[^\n=]*==)([^=\r ])"
> (allowing for the fact that excess spaces on the end aren't important)  to
> be replaced by     "\\1\n\\2"
>
> But I get many false matches. See http://www.pastie.org/913753 for details
> of the good and the false matches.
>
>
> In #regex on freenode I was told to try:
> "s/((={2,}).*?\2)(?!\n)([^=]?)/\1\n\2/g" but it gives the error: "bash: !\n:
> event not found".

Regarding this particular issue, you should read
http://mywiki.wooledge.org/BashPitfalls#echo_.22Hello_World.21.22

Using single quotes instead of double quotes should work. Or just put
"set +o histexpand" in your .bashrc ...

>
> I'm told that it works - http://pastie.org/913765 - but in my terminal I
> can't get past the bash error.
>
>
> Thanks!
>
> --
> Chris Watkins
>
> Appropedia.org - Sharing knowledge to build rich, sustainable lives.
>
> blogs.appropedia.org
> community.livejournal.com/appropedia
> identi.ca/appropedia
> twitter.com/appropedia
>
> _______________________________________________
> Pywikipedia-l mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>
>



-- 
Nicolas Dumazet — NicDumZ

_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to