09-22-2006
Hi Scorreg,
In perl we most often we use directl pattern matching. This 'm' is nothin but the match operator, often used in conjunction with the bind operator(~).
'^' just signifies the start of the pattern and '!' is delimiter.
You can write the same as ......
=~ {^(/.*)/bin/xx}
Now the 'm' is absent and '{' and '}' are delimiters!!
4 More Discussions You Might Find Interesting
1. OS X (Apple)
Can anyone point me to a resource (or answer my question) that will show me how to automatically run a script in OSX when a device is plugged in. The OS recognizes that the device is plugged in but how do I direct it to do something I want it to do.
it seems that linux has udev but what would... (2 Replies)
Discussion started by: djkuzenko
2 Replies
2. Shell Programming and Scripting
Hi
i want to search two pattern on same line and replace onther pattern..
INPut file
aaaa bbbbb nnnnnn ttttt
cccc bbbbb nnnnnn ppppp
dddd ccccc nnnnnn ttttt
ffff bbbbb oooooo ttttt
now i want replace this matrix like.. i want search for "bbbbb","nnnnnn" and search and replace for... (4 Replies)
Discussion started by: nitindreamz
4 Replies
3. Shell Programming and Scripting
Hi ,
I have a file. I would like to split each line into 3 value.
Ex:
i/p line:
09.11.12 04:40: 561 users on GCSS_gcsspr3a.
Expect output:
$a=09.11.12 04:40
$b=561
$c=GCSS_gcsspr3a.
Any idea plz
Thanks,
Mani (1 Reply)
Discussion started by: Mani_apr08
1 Replies
4. UNIX for Beginners Questions & Answers
Hi, I would need some help extracting the desired data from the following text:
# Time_result: 1.056179 next_value: 0.000077
OTHER VALUE 445552341;
SELECT row with values
# IP = 192.168.1.15
# Time: 45
# Time_result: 100.15 next_value: 0.000077
OTHER VALUE 445552341;
SELECT row with... (2 Replies)
Discussion started by: alex2005
2 Replies
LEARN ABOUT OPENDARWIN
tcl_stringcasematch
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)