hi james

this looks cool.
did you experiment things like Markdown
(http://daringfireball.net/projects/markdown/) or such text to html
converters ?

my suggestion for a lighter regexp (untested) :
$pattern = "[EMAIL PROTECTED]([^=]*)=([^=]*)[EMAIL PROTECTED]";
$replaces = array();
if(preg_match_all($pattern,$str,$matches)){
  for($i=0;$i<count($matches[0]);$i++){
    $full_tag = $matches[0][$i];
    $command = $matches[1][$i];
    $argument = $matches[2][$i];
    $replaces[$full_tag] = my_html_generator($command,$argument);
  }
  $output = strtr($str,$replaces); // there's probably a faster way by
using PREG_OFFSET_CAPTURE
}

Regexp are so cool. I remember when I discovered that, I found myself
very powerful...

+++++++++
Clément

On Fri, Oct 31, 2008 at 1:46 AM, james jwm-art net <[EMAIL PROTECTED]> wrote:
> working toward open-sourcing jwm-art.net
> text-file-based content (*)management system...
>
>    *maybe mis-management
>
> some lines that might be found in a text file
> for a page on jwm-art.net:
>
>    main=text=a line of text with a link to the @=ilink=test=@ page.
>    [EMAIL PROTECTED]<<ENDTEXTLINE=@
>    at-tags allow links and other HTML elements to be embedded
>    within a paragraph of text. text as presented in the text
>    file for a page is strictly formatted to @=b=prevent=@
>    characters used in HTML from being interpretted as such.
>    ENDTEXTLINE
>    main=image=ride-03@:image from ride-03 page.
>
> testing a regular expression for detection of
> 'at-tags' - jwm-art.net-style delimiters for
> embedding HTML elements within text.
>
>    (took eight hours to learn how to use regular)
>    (expressions to arrive at what i thought)
>    (worked in all cases but did not)
>
> http://www.jwm-art.net/test.php
>
> test:    $pat='/((?:@=[a-z]+)(?:=@|=[\S ]+?(?==@)))/';
> actual:  $pat='/((?:@=[!a-z\\/\\\]+)(?:=@|=[\S \n]+?(?==@)))/';
> for use: $res=preg_split($pat,$str,-1,PREG_SPLIT_DELIM_CAPTURE);
> (((allows things like @=b=bold\nbold\nstill bold=@ (where line split in
> file)
> (((and @=\=display-at-tag=@ @=/=html comment=@ etc
> (((and @=!=some kind of conditional ICROH used mainly by journal =@
>
> more:
>    http://www.jwm-art.net/light.php?p=test
>
> more splitting out of functions for these things...
>
> keywords page displays the first few lines from the info section of
> a page. look here (notice links):
>
> http://www.jwm-art.net/light.php?p=str-frag-1.0
>
> then look at the same information in the keywords listing for that
>
> http://www.jwm-art.net/light.php?p=keywords&k=chaos
>
> (( code now less confuse so link never made
> (( as link never made, never get format
> (( so link element never dis-splayed, like old.
>
> ----------
>
> steps to open source
>
> 1) further study of my code and thinking ways to improve it
> 2) removing content from potential src package
> 3) creating documentation for usage of src as content
>
> 4) remember that we(i) were(was) going to help people out
>   by closing open tags (ie for bold text, italic etc)
>   span anyone? hmmmm, exists, but, but, maybe we have to
>   be crawl to be kined?
>
> 5) remember to investigate keyword functioning for potential
>   code efficiency improvements(ie is it possible to avoid:
>      grep key1 | grep key2 | grep key3 in favour of regular
>   expression? can more advanced regexps help in keyword
>   functioning?
>
> 6) stop blabbling so much
>
> _______________________________________________
> NetBehaviour mailing list
> [email protected]
> http://www.netbehaviour.org/mailman/listinfo/netbehaviour
>

_______________________________________________
NetBehaviour mailing list
[email protected]
http://www.netbehaviour.org/mailman/listinfo/netbehaviour

Reply via email to