Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[COLOR=#0000ff]# matching single line string[/color]
[COLOR=#804040][b]set[/b][/color] output [COLOR=#ff00ff]"omppclb> error: fialed due to mismatch of values Existed value : 20000 expected value: 40000 omppclb>"[/color]
[COLOR=#804040][b]set[/b][/color] result [[COLOR=#804040][b]regexp[/b][/color] {omppclb>\s*(.+)\s*omppclb>} [COLOR=#008080]$output[/color] match str_extr];
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"String to apply the pattern:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$output[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"result=[/color][COLOR=#008080]$result[/color][COLOR=#ff00ff]"[/color]
[COLOR=#804040][b]if[/b][/color] {[COLOR=#008080]$result[/color]} {
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"This was matched:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$match[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"String extracted:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$str_extr[/color][COLOR=#ff00ff]'"[/color]
}
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"[/color][COLOR=#6a5acd]\n\n[/color][COLOR=#ff00ff]"[/color]
[COLOR=#0000ff]# matching multi line string[/color]
[COLOR=#804040][b]set[/b][/color] output [COLOR=#ff00ff]"omppclb> error: fialed due to mismatch of values[/color]
[COLOR=#ff00ff] Existed value : 20000[/color]
[COLOR=#ff00ff] expected value: 40000[/color]
[COLOR=#ff00ff] omppclb>"[/color]
[COLOR=#804040][b]set[/b][/color] result [COLOR=#ff0000]\[/color]
[[COLOR=#804040][b]regexp[/b][/color] -lineanchor {omppclb>\s*(.+)\s*omppclb>} [COLOR=#008080]$output[/color] match str_extr];
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"String to apply the pattern:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$output[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"result=[/color][COLOR=#008080]$result[/color][COLOR=#ff00ff]"[/color]
[COLOR=#804040][b]if[/b][/color] {[COLOR=#008080]$result[/color]} {
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"This was matched:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$match[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"String extracted:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$str_extr[/color][COLOR=#ff00ff]'"[/color]
}
String to apply the pattern:
'omppclb> error: fialed due to mismatch of values Existed value : 20000 expected
value: 40000 omppclb>'
result=1
This was matched:
'omppclb> error: fialed due to mismatch of values Existed value : 20000 expected
value: 40000 omppclb>'
String extracted:
'error: fialed due to mismatch of values Existed value : 20000 expected value: 4
0000 '
String to apply the pattern:
'omppclb> error: fialed due to mismatch of values
Existed value : 20000
expected value: 40000
omppclb>'
result=1
This was matched:
'omppclb> error: fialed due to mismatch of values
Existed value : 20000
expected value: 40000
omppclb>'
String extracted:
'error: fialed due to mismatch of values
Existed value : 20000
expected value: 40000
'
[COLOR=#804040][b]proc[/b][/color] extract_string {str} {
[COLOR=#804040][b]set[/b][/color] result [COLOR=#ff0000]\[/color]
[[COLOR=#804040][b]regexp[/b][/color] -lineanchor [COLOR=#ff0000]\[/color]
{omppcl(b|h|v4)\s*[root]*\s*>\s*(.+)\s*omppcl(b|h|v4)\s*[root]*\s*>} [COLOR=#ff0000]\[/color]
[COLOR=#008080]$str[/color] match tmp str_extr];
[COLOR=#804040][b]if[/b][/color] {[COLOR=#008080]$result[/color]} {
[COLOR=#804040][b]return[/b][/color] [COLOR=#008080]$str_extr[/color]
}
}
[COLOR=#0000ff]#------------------------------------------------------------------------[/color]
[COLOR=#0000ff]# matching single line string[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"Matching single line string:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]"[/color]
[COLOR=#804040][b]set[/b][/color] my_string [COLOR=#ff00ff]"omppclb> error: fialed due to mismatch of values Existed value : 20000 expected value: 40000 omppclb>"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"String to apply the pattern:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$my_string[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]set[/b][/color] my_substring [extract_string [COLOR=#008080]$my_string[/color]]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"Substring extracted:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$my_substring[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"[/color][COLOR=#6a5acd]\n\n[/color][COLOR=#ff00ff]"[/color]
[COLOR=#0000ff]#------------------------------------------------------------------------[/color]
[COLOR=#0000ff]# matching multi line strings[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"Matching multi line strings:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]"[/color]
[COLOR=#804040][b]set[/b][/color] my_string [COLOR=#ff00ff]"omppclb > error: fialed due to mismatch of values[/color]
[COLOR=#ff00ff] Existed value : 20000[/color]
[COLOR=#ff00ff] expected value: 40000[/color]
[COLOR=#ff00ff] omppclb>"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"String to apply the pattern:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$my_string[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]set[/b][/color] my_substring [extract_string [COLOR=#008080]$my_string[/color]]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"Substring extracted:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$my_substring[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]"[/color]
[COLOR=#804040][b]set[/b][/color] my_string [COLOR=#ff00ff]"omppclh root > error: fialed due to mismatch of values[/color]
[COLOR=#ff00ff] Existed value : 20000[/color]
[COLOR=#ff00ff] expected value: 40000[/color]
[COLOR=#ff00ff] omppclh root>"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"String to apply the pattern:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$my_string[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]set[/b][/color] my_substring [extract_string [COLOR=#008080]$my_string[/color]]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"Substring extracted:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$my_substring[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]"[/color]
[COLOR=#804040][b]set[/b][/color] my_string [COLOR=#ff00ff]"omppclv4 root> error: fialed due to mismatch of values[/color]
[COLOR=#ff00ff] Existed value : 20000[/color]
[COLOR=#ff00ff] expected value: 40000[/color]
[COLOR=#ff00ff] omppclv4 root >"[/color]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"String to apply the pattern:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$my_string[/color][COLOR=#ff00ff]'"[/color]
[COLOR=#804040][b]set[/b][/color] my_substring [extract_string [COLOR=#008080]$my_string[/color]]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#ff00ff]"Substring extracted:[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]'[/color][COLOR=#008080]$my_substring[/color][COLOR=#ff00ff]'"[/color]
Matching single line string:
String to apply the pattern:
'omppclb> error: fialed due to mismatch of values Existed value : 20000 expected
value: 40000 omppclb>'
Substring extracted:
'error: fialed due to mismatch of values Existed value : 20000 expected value: 4
0000 '
Matching multi line strings:
String to apply the pattern:
'omppclb > error: fialed due to mismatch of values
Existed value : 20000
expected value: 40000
omppclb>'
Substring extracted:
'error: fialed due to mismatch of values
Existed value : 20000
expected value: 40000
'
String to apply the pattern:
'omppclh root > error: fialed due to mismatch of values
Existed value : 20000
expected value: 40000
omppclh root>'
Substring extracted:
'error: fialed due to mismatch of values
Existed value : 20000
expected value: 40000
'
String to apply the pattern:
'omppclv4 root> error: fialed due to mismatch of values
Existed value : 20000
expected value: 40000
omppclv4 root >'
Substring extracted:
'error: fialed due to mismatch of values
Existed value : 20000
expected value: 40000