Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tcl_stringcasematch(3) [opendarwin man page]

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(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)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help need for pattern matching

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)
Discussion started by: HIMANI
10 Replies

2. UNIX for Dummies Questions & Answers

Pattern Replacement

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)
Discussion started by: palash2k
12 Replies

3. Linux

matching pattern and replacement

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)
Discussion started by: capri_drm
32 Replies

4. Shell Programming and Scripting

Does Filename Match Pattern

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)
Discussion started by: msb65
10 Replies

5. Shell Programming and Scripting

case-insensitive search with AWK

Hi All, How we can perform case-insensitive search with AWK.:rolleyes: regards, Sam (11 Replies)
Discussion started by: sam25
11 Replies

6. Shell Programming and Scripting

How to test if part of a string matches?

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)
Discussion started by: wolfv
15 Replies

7. UNIX for Dummies Questions & Answers

awk -repeated pattern match

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)
Discussion started by: danieladna
12 Replies

8. Shell Programming and Scripting

pattern matching

Hi, any idea how to extract alphabets alone in the string which contains numbers and alphabets. Thanks in advance! (11 Replies)
Discussion started by: nram_krishna@ya
11 Replies

9. UNIX for Dummies Questions & Answers

How to append portion of a file content to another file when a certain pattern is matching?

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)
Discussion started by: bananamen
25 Replies

10. Shell Programming and Scripting

Finding the pattern and replacing the pattern inside the file

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)
Discussion started by: saaisiva
16 Replies

11. Shell Programming and Scripting

Split Large Files Based On Row Pattern..

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)
Discussion started by: aimy
13 Replies

12. Shell Programming and Scripting

Searching and printing only required pattern

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)
Discussion started by: omkar.jadhav
11 Replies

13. Shell Programming and Scripting

Replacing lines matching a multi-line pattern (sed/perl/awk)

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)
Discussion started by: thefang
10 Replies

14. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'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)
Discussion started by: essem
11 Replies

15. Shell Programming and Scripting

awk pattern matching

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)
Discussion started by: vegasluxor
20 Replies