Re: [PHP] Regexp stopped working on my site

2005-01-30 Thread Kristian Hellquist
The expression that I found won't work anymore is an own pseudo-lang
markup that renders into html-lists.

Expression for grabbing a list, Example: 
[lista] some text [/lista]

@\[\s*(lista)\s*(sq|o|\*|#|a|i)?\s*\]([^\x00]*?)\[/[EMAIL PROTECTED]


$3 is then treated separated into html list-items .
List-items are created by a pseudotag [punkt] or linebreaks. Its one
way, you can't mix them both here.

// Explode the string into an array
$hits = preg_split('#(\[\s*punkt\s*\][^\x00]*?\[/\s*\punkt\s*\])#',
$matches[3], -1, PREG_SPLIT_DELIM_CAPTURE);
$textarray=array();

foreach($hits as $index=>$element){

if(  ($index%2)==0){
// strings
$element = preg_split('/\s*\r+
\s*/', trim($element), -1, PREG_SPLIT_NO_EMTPY);

foreach($element as $val){
// Replace innerstyles
if(strlen(trim
($val))>0){
// Replace
nestled lists
//$val=$this-
>search_and_replace($val, $this->_reg_search['lista'] );
$val=$this-
>_check_content($val , $matches[1] );
// Add list
element
array_push
($textarray, ''.$val.'');
}
}

}else{
// [punkt]
$element=preg_replace('#
\[\s*punkt\s*\]([^\x00]*?)\[/\s*\punkt\s*\]#', '$1',$element);
// replace linebreaks
$element = preg_replace('/\r/',
'', $element);

// Replace innerstyles
// Replace nestled lists
//$val=$this->search_and_replace
($val, $this->_reg_search['lista'] );
$element=$this->_check_content
($element , $matches[1] );

// Add list element
    array_push($textarray, ''.$element.'');
}
}






> Kristian Hellquist wrote:
> > Hi!
> > 
> > I had a script for parsing text into html, similar to phpBB. Everything
> > has been working fine until now. Some of my 'pseudotags' like [b] are
> > still recognized (parsed into ) but some more advanced pattern
> > matching is not. I haven't changed the code, but the php-version on the
> > server has changed from "default" on debian-woody to php-4.3.10. I
> > haven't made the upgrade myself.
> > 
> > The users of the site reported the bug to me this week, but the users
> > aren't active so I don't really know when then bug was created. Because
> > I know it has worked before.
> > 
> > Does any of you have a clue or experience of this? Or has my code been
> > mysterious altered on the server?
> 
> An example of the expressions?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Regular expressions stopped working

2005-01-29 Thread Kristian Hellquist
Hi!

I had a script for parsing text into html, similar to phpBB. Everything
has been working fine until now. Some of my 'pseudotags' like [b] are
still recognized (parsed into ) but some more advanced pattern
matching is not. I haven't changed the code, but the php-version on the
server has changed from "default" on debian-woody to php-4.3.10. I
haven't made the upgrade myself.

The users of the site reported the bug to me this week, but the users
aren't active so I don't really know when then bug was created. Because
I know it has worked before.

Does any of you have a clue or experience of this? Or has my code been
mysterious altered on the server?

Thanks!
Kristian

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Regexp stopped working on my site

2005-01-29 Thread Kristian Hellquist
Hi!

I had a script for parsing text into html, similar to phpBB. Everything
has been working fine until now. Some of my 'pseudotags' like [b] are
still recognized (parsed into ) but some more advanced pattern
matching is not. I haven't changed the code, but the php-version on the
server has changed from "default" on debian-woody to php-4.3.10. I
haven't made the upgrade myself.

The users of the site reported the bug to me this week, but the users
aren't active so I don't really know when then bug was created. Because
I know it has worked before.

Does any of you have a clue or experience of this? Or has my code been
mysterious altered on the server?

Thanks!
Kristian

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php