[pmwiki-users] custom markup/regular expression help

Bronwyn Boltwood bronwyn at bronwynb.info
Fri Apr 28 16:56:51 CDT 2006


On 28 Apr 2006 11:05:01 +1200, John Rankin <john.rankin at affinity.co.nz> wrote:
> On Thursday, 27 April 2006 11:06 PM, Bronwyn Boltwood <bronwyn at bronwynb.info> wrote:
> >I agree that semicolons could have some strange effects, but they are
> >simple, which is really important in this case.  And as a trained
> >writer, I know how they should be used; they should be used to connect
> >what would normally be two separate but very closely related
> >sentences.
>
> As long as you are the only writer, that's OK then. I didn't intend
> to imply you were unaware of correct usage; my apologies if I gave
> that impression.

No, you didn't, and I didn't mean to give the impression that you had.
:)  AFAIK I will probably be the only writer, or else the others are
likely to be technical enough to understand finicky detail.  This
place supports enterprise-level firewalls.

> >So, the markup could check for (1) no whitespace between
> >the initial semicolon and the text, and (2) whitespace after the final
> >semicolon.  Normal semicolon use should not fit this pattern. Would
> >that resolve the problem?
>
> (1) yes but (2) maybe not. A space normally follows a semicolon, so
> rule 2 doesn't add anything unique and it prevents you from following
> ;text; markup with a .,;:'"?! mark.
>
> Try it with just rule 1:
>
>     '/;([^\s].*?);/' -> '<span class="xxx">$1</span>' (or equivalent)

Good point.  I shall have to test these out over the weekend. :)  Thank you.

Bronwyn
--
"I have learned two ways to tie my shoes. One way is only good for
lying down. The other way is good for walking." -- Valentine Michael
Smith, _Stranger in a Strange Land_ by Robert A. Heinlein




More information about the pmwiki-users mailing list