Error processing request
Parameters
CONTENT_LENGTH | 0 |
REQUEST_METHOD | GET |
REQUEST_URI | /revision/Advanced+Regular+Expression+Examples?V=0 |
QUERY_STRING | V=0 |
CONTENT_TYPE | |
DOCUMENT_URI | /revision/Advanced+Regular+Expression+Examples |
DOCUMENT_ROOT | /var/www/nikit/nikit/nginx/../docroot |
SCGI | 1 |
SERVER_PROTOCOL | HTTP/1.1 |
REMOTE_ADDR | 172.71.254.204 |
REMOTE_PORT | 57876 |
SERVER_PORT | 8888 |
SERVER_NAME | wiki.tcl-lang.org |
HTTP_HOST | wiki.tcl-lang.org |
HTTP_CONNECTION | Keep-Alive |
HTTP_ACCEPT_ENCODING | gzip |
HTTP_X_FORWARDED_FOR | 3.138.151.252 |
HTTP_CF_RAY | 88cccea2db9d22d5-ORD |
HTTP_X_FORWARDED_PROTO | http |
HTTP_CF_VISITOR | {"scheme":"http"} |
HTTP_ACCEPT | */* |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected]) |
HTTP_CF_CONNECTING_IP | 3.138.151.252 |
HTTP_CDN_LOOP | cloudflare |
HTTP_CF_IPCOUNTRY | US |
Body
Error
Unknow state transition: LINE -> END
-code
1
-level
0
-errorstack
INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {Advanced Regular Expression Examples} {Solve a nasty regular expression problem? Share your examples for the benefit of others here. Please include the problem statement, the code and then any discussion.
----
'''Problem Statement: ''' Modify a string with a series of substrings enclosed in double square brackets ([[ ]]) such that they become only single brackets. Example input: " [[X]] [[abc]] [[123]] ", desired output: " [X] [abc] [123] ". The actual substrings could be any arbitrarily nasty text, including such things as &, \1 etc.
'''Code: ''' ======
regsub -all {\[\[(.*?)\]\]} $thebody {[\1]} thebody
======
'''Discussion: ''' The non-greedy expression .*? will expand all text until the first match of ]]. Works great. This example comes from [Wiki Conversion OddMuse To Confluence] where you can find the entire example.
----
'''Problem Statement: ''' Modify a string containing a series of substrings enclosed in double square brackets ([[ ]]) such that any spaces in that substring are converted to underscores (_).
'''Code: ''' ======
while { [regsub -all {(\[\[[^] ]+) (.+?\]\])} $thebody {\1_\2} thebody] > 0 } {}
OR
set idx [regexp -inline -all -indices {\[[^]]*\]} $txt]
foreach pair $idx {
foreach {start end} $pair { break }
set new [string map [list { } _] [string range $txt $start $end]]
set txt [string replace $txt $start $end $new]
}
======
'''Discussion: ''' In the first line, a complete iterative approach is taken. Where there are many more substrings than there are spaces in those substrings, this method clearly computationally efficient. This example comes from [Wiki Conversion OddMuse To Confluence] where you can find the entire example. If there are more spaces than substrings then, at some point, it becomes more computationally effficient to follow the second set of statements. Those statements were constructed by another person on the Tcler's Chat. There does not seem to be a way to solve this problem in a single step.
----
*** Recommended Template
'''Problem Statement: '''
'''Code: ''' ======
======
'''Discussion: '''
----} regexp2} CALL {my render {Advanced Regular Expression Examples} {Solve a nasty regular expression problem? Share your examples for the benefit of others here. Please include the problem statement, the code and then any discussion.
----
'''Problem Statement: ''' Modify a string with a series of substrings enclosed in double square brackets ([[ ]]) such that they become only single brackets. Example input: " [[X]] [[abc]] [[123]] ", desired output: " [X] [abc] [123] ". The actual substrings could be any arbitrarily nasty text, including such things as &, \1 etc.
'''Code: ''' ======
regsub -all {\[\[(.*?)\]\]} $thebody {[\1]} thebody
======
'''Discussion: ''' The non-greedy expression .*? will expand all text until the first match of ]]. Works great. This example comes from [Wiki Conversion OddMuse To Confluence] where you can find the entire example.
----
'''Problem Statement: ''' Modify a string containing a series of substrings enclosed in double square brackets ([[ ]]) such that any spaces in that substring are converted to underscores (_).
'''Code: ''' ======
while { [regsub -all {(\[\[[^] ]+) (.+?\]\])} $thebody {\1_\2} thebody] > 0 } {}
OR
set idx [regexp -inline -all -indices {\[[^]]*\]} $txt]
foreach pair $idx {
foreach {start end} $pair { break }
set new [string map [list { } _] [string range $txt $start $end]]
set txt [string replace $txt $start $end $new]
}
======
'''Discussion: ''' In the first line, a complete iterative approach is taken. Where there are many more substrings than there are spaces in those substrings, this method clearly computationally efficient. This example comes from [Wiki Conversion OddMuse To Confluence] where you can find the entire example. If there are more spaces than substrings then, at some point, it becomes more computationally effficient to follow the second set of statements. Those statements were constructed by another person on the Tcler's Chat. There does not seem to be a way to solve this problem in a single step.
----
*** Recommended Template
'''Problem Statement: '''
'''Code: ''' ======
======
'''Discussion: '''
----}} CALL {my revision {Advanced Regular Expression Examples}} CALL {::oo::Obj110612 process revision/Advanced+Regular+Expression+Examples} CALL {::oo::Obj110610 process}
-errorcode
NONE
-errorinfo
Unknow state transition: LINE -> END
while executing
"error $msg"
(class "::Wiki" method "render_wikit" line 6)
invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
(class "::Wiki" method "render" line 8)
invoked from within
"my render $name $C"
(class "::Wiki" method "revision" line 31)
invoked from within
"my revision $page"
(class "::Wiki" method "process" line 56)
invoked from within
"$server process [string trim $uri /]"
-errorline
4