Tcl_StringMatch(3) Tcl Library Procedures Tcl_StringMatch(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_StringMatch, Tcl_StringCaseMatch - test whether a string matches a pattern
SYNOPSIS
#include <tcl.h>
int
Tcl_StringMatch(string, pattern)
int
Tcl_StringCaseMatch(string, pattern, nocase)
ARGUMENTS
char *string (in) String to test.
char *pattern (in) Pattern to match against string. May contain special characters from the set *?[].
int nocase (in) Specifies whether the match should be done case-sensitive (0) or case-insensitive (1).
_________________________________________________________________DESCRIPTION
This utility procedure determines whether a string matches a given pattern. If it does, then Tcl_StringMatch returns 1. Otherwise
Tcl_StringMatch returns 0. The algorithm used for matching is the same algorithm used in the ``string match'' Tcl command and is similar
to the algorithm used by the C-shell for file name matching; see the Tcl manual entry for details. |
In Tcl_StringCaseMatch, the algorithm is the same, but you have the option to make the matching case-insensitive. If you choose this (by |
passing nocase as 1), then the string and pattern are essentially matched in the lower case.
KEYWORDS
match, pattern, string
Tcl 8.1 Tcl_StringMatch(3)
Check Out this Related Man Page
Tcl_StringMatch(3TCL) Tcl Library Procedures Tcl_StringMatch(3TCL)__________________________________________________________________________________________________________________________________________________NAME
Tcl_StringMatch, Tcl_StringCaseMatch - test whether a string matches a pattern
SYNOPSIS
#include <tcl.h>
int
Tcl_StringMatch(string, pattern)
int
Tcl_StringCaseMatch(string, pattern, nocase)
ARGUMENTS
char *string (in) String to test.
char *pattern (in) Pattern to match against string. May contain special characters from the set *?[].
int nocase (in) Specifies whether the match should be done case-sensitive(0) or case-insensitive(1).
_________________________________________________________________DESCRIPTION
This utility procedure determines whether a string matches a given pattern. If it does, then Tcl_StringMatch returns 1. Otherwise
Tcl_StringMatch returns 0. The algorithm used for matching is the same algorithm used in the ``string match'' Tcl command and is similar
to the algorithm used by the C-shell for file name matching; see the Tcl manual entry for details. |
In Tcl_StringCaseMatch, the algorithm is the same, but you have the option to make the matching case-insensitive. If you choose this (by |
passing nocase as 1), then the string and pattern are essentially matched in the lower case.
KEYWORDS
match, pattern, string
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tcl 8.1 Tcl_StringMatch(3TCL)
Hi,
I have a shell script that gives output in the form :
abc/xyz/delays/A1toB1_000000
pqr/trf/delays/AtoB_45678567
etc
I need tget the pattern A1toB1 , AtoB etc from this output.
Can some one please tell me how this can be done.
Thanks,
Himi (10 Replies)
There is a requirement that i need to replaced a pattern by another pattern in all the files in my entire file system. there are 1000s of file in the system. let the pattern is "calcuta". i have to replace this pattern by "kolkata" in all those files which contain "calcuta".
I am only able to... (12 Replies)
Hi
I am trying to look for a view name in create view statement and then replace this view name with VW_ in grants line in my ddl file .
cat dim_provider.sql | grep -i "create view" | while read f1 f2 f3 f4 f5 f6 f7 f8 f9
do
new_vw=` echo "$f3" | cut -d "." -f2... (32 Replies)
Hi,
I am writing a BASH script. I have a list of files and I would like to make sure that each is of a specific pattern (ie *.L2). If not I would like to remove that file. How do I test whether a filename matches a given pattern?
Thanks a lot.
Mike (10 Replies)
How to test if the first 7 characters of a string matches "backup."?
This did not work:
#!/bin/sh
name="backup.20091122"
if
then
echo name is a backup
else
echo name is not a backup
fiThank you. (15 Replies)
Hi.
How can I write this differently:
awk '$3 ~ /0001/{print}'
Is there a way to write 0001 differently. I am looking for the pattern 01, with 3 or more 0 and 3 or more 1 in a pattern.
Thanks. (12 Replies)
Hi ladies and gentleman.. I have two text file with me. I need to replace one of the file content to another file if one both files have a matching pattern.
Example:
text1.txt:
ABCD 1234567,HELLO_WORLDA,HELLO_WORLDB
DCBA 3456789,HELLO_WORLDE,HELLO_WORLDF
text2.txt:
XXXX,ABCD... (25 Replies)
i have little challenge, help me out.i have a file where i have a value declared and and i have to replace the value when called. for example i have the value for abc and ccc. now i have to substitute the value of
value abc and ccc in the place of them.
Input File:
go to &abc=ddd;
if... (16 Replies)
Hi all.
I've tried searching the web but could not find similar problem to mine.
I have one large file to be splitted into several files based on the matching pattern found in each row.
For example, let's say the file content:
... (13 Replies)
Hi all,
i am trying to count the number of logical processors from the below output:
# print_manifest | grep "logical processors"
8 cores, 16 logical processors per socket
2 logical processors (2 per socket)
i just want to have below output :
16
2
also... (11 Replies)
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
I have two files, want to compare file1 data with file2 second column and print line which are not matching. Need help in matching the pattern, file2 second column number can be leading 0 or 00 or 000.
Example:
file1
1
2
3
file2
a,0001
b,02
c,000
d,01
e,2
f,0005
Expected output:... (20 Replies)