Sponsored Content
Top Forums Shell Programming and Scripting perl regex string match issue..kindly help Post 302710149 by Skrynesaver on Thursday 4th of October 2012 03:43:11 AM
Old 10-04-2012
I'm unfamiliar with the asterix as comment convention, however if you wish to skip from any occurrence of an asterix to the end of the line, you could capture the comment (or indeed ignore it, as follows:
Code:
~$ perl -e 'my $data="{*cheese"; print "$1\n" if $data=~/^{\*+([^*]+)?\**$/;'
cheese

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Regex string opperation

I'm working on a basic log parser in perl. Input file looks like: len: 120713 foo bar file size of: testdir1/testdir1/testdir1/testdir1/testfile0 is 120713Of course there are tens of thousands of lines... I'm trying to compare the len and filesize values. #!/usr/bin/perl use strict; use... (2 Replies)
Discussion started by: dkozel
2 Replies

2. Shell Programming and Scripting

Perl REGEX - How do extract a string in a line?

Hi Guys, In the following line: cn=portal.090710.191533.428571000,cn=groups,dc=mp,dc=rj,dc=gov,dc=br I need to extract this string: portal.090710.191533.428571000 As you can see this string always will be bettween "cn=" and "," strings. Someone know one regular expression to... (4 Replies)
Discussion started by: maverick-ski
4 Replies

3. UNIX for Dummies Questions & Answers

Regex to match when input is not a certain string (can't use grep -v)

Hey everyone, Basically, all I'm looking for is a way to regex for not a certain string. The regex I'm looking to avoid matching is: D222 i.e. an equivalent of: awk '!/D222/' The problem is that I use this in the following command in a Bash script: ls ${source_directory} | awk... (1 Reply)
Discussion started by: kdelok
1 Replies

4. Shell Programming and Scripting

Issues with an exact match using regex in perl!

Hello Guys, I am trying to make an exact match for an email address entered as an argument, using perl, however, it's not working if I put a "$" in the email address. See the below outputs, Correct Match : bash-2.03$ echo sandy@test.com | perl -wln -e 'print if /(^*\@test.com$)/i'... (6 Replies)
Discussion started by: suffisandy
6 Replies

5. Shell Programming and Scripting

Perl: Regex, string matching

Hi, I've a logfile which i need to parse and get the logs depending upon the user input. here, i'm providing an option to enter the string which can be matched with the log entries. e.g. one of the logfile entry reads like this - $str = " mpgw(BLUESOAPFramework):... (6 Replies)
Discussion started by: butterfly20
6 Replies

6. Shell Programming and Scripting

Perl newbie - regex replace all groups issue

Hello, Although I have found similar questions, I could not find advice that could help with my problem. The issue: I am trying to replace all occurrences of a regex, but I cannot make the regex groups work together. This is a simple input test file: The Vedanta Philosophy... (3 Replies)
Discussion started by: samask
3 Replies

7. Shell Programming and Scripting

perl regex issue

Hi, I find it really strange while writing a simple regex to match and print the matched string, dibyajyo@fwtest:~ #perl -e '$x = "root@rashmi>"; print "matched string:$1\n" if ($x =~ /(root@rashmi)/);' matched string:root dibyajyo@fwtest:~ #perl -e '$x = "root@rashmi>"; print... (1 Reply)
Discussion started by: rrd1986
1 Replies

8. Shell Programming and Scripting

Perl:Regex for Search and Replace that has a flexible match

Hi, I'm trying to match the front and back of a sequence. It works when there is an exact match (obviously), but I need the regex to be more flexible. When we get strings of nucleotides sometimes their prefixes and suffixes aren't exact matches. Sometimes there will be an extra letter and... (2 Replies)
Discussion started by: jdilts
2 Replies

9. Shell Programming and Scripting

Print lines that match regex on xth string

Hello, I need an awk command to print only the lines that match regex on xth field from file. For example if I use this command awk -F"|" ' $22 == "20130117090000.*" 'It wont work, I think, because single quotes wont allow the usage of the metacharacter star * . On the other hand I dont know... (2 Replies)
Discussion started by: black_fender
2 Replies

10. Shell Programming and Scripting

Sendmail K command regex: adding exclusion/negative lookahead to regex -a@MATCH

I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works: LOCAL_CONFIG # Kcheckaddress regex -a@MATCH +<@+?\.++?\.(us|info|to|br|bid|cn|ru) LOCAL_RULESETS SLocal_check_mail # check address against various regex... (0 Replies)
Discussion started by: RobbieTheK
0 Replies
labelframe(n)						       Tk Built-In Commands						     labelframe(n)

__________________________________________________________________________________________________________________________________________________

NAME
labelframe - Create and manipulate labelframe widgets SYNOPSIS
labelframe pathName ?options? STANDARD OPTIONS
-borderwidth -highlightbackground -pady -cursor -highlightcolor -relief -font -highlightthickness -takefocus -foreground -padx -text See the options manual entry for details on the standard options. WIDGET-SPECIFIC OPTIONS [-background background] This option is the same as the standard background option except that its value may also be specified as an empty string. In this case, the widget will display no background or border, and no colors will be consumed from its colormap for its background and border. [-class class] Specifies a class for the window. This class will be used when querying the option database for the window's other options, and it will also be used later for other purposes such as bindings. The class option may not be changed with the configure widget command. [-colormap colormap] Specifies a colormap to use for the window. The value may be either new, in which case a new col- ormap is created for the window and its children, or the name of another window (which must be on the same screen and have the same visual as pathName), in which case the new window will use the colormap from the specified window. If the colormap option is not specified, the new window uses the same colormap as its parent. This option may not be changed with the configure widget command. [-container container] The value must be a boolean. If true, it means that this window will be used as a container in which some other application will be embed- ded (for example, a Tk toplevel can be embedded using the -use option). The window will support the appropriate window manager protocols for things like geometry requests. The window should not have any children of its own in this application. This option may not be changed with the configure widget command. [-height height] Specifies the desired height for the window in any of the forms acceptable to Tk_Get- Pixels. If this option is less than or equal to zero then the window will not request any size at all. [-labelanchor labelAnchor] Speci- fies where to place the label. A label is only displayed if the -text option is not the empty string. Valid values for this option are (listing them clockwise) nw, n, ne, en, e, es, se, s,sw, ws, w and wn. The default value is nw. [-labelwidget labelWidget] Specifies a widget to use as label. This overrides any -text option. The widget must exist before being used as -labelwidget and if it is not a descen- dant of this window, it will be raised above it in the stacking order. [-visual visual] Specifies visual information for the new window in any of the forms accepted by Tk_GetVisual. If this option is not specified, the new window will use the same visual as its parent. The visual option may not be modified with the configure widget command. [-width width] Specifies the desired width for the window in any of the forms acceptable to Tk_GetPixels. If this option is less than or equal to zero then the window will not request any size at all. _________________________________________________________________ DESCRIPTION
The labelframe command creates a new window (given by the pathName argument) and makes it into a labelframe widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the labelframe such as its back- ground color and relief. The labelframe command returns the path name of the new window. A labelframe is a simple widget. Its primary purpose is to act as a spacer or container for complex window layouts. It has the features of a frame plus the ability to display a label. WIDGET COMMAND
The labelframe command creates a new Tcl command whose name is the same as the path name of the labelframe's window. This command may be used to invoke various operations on the widget. It has the following general form: pathName option ?arg arg ...? PathName is the name of the command, which is the same as the labelframe widget's path name. Option and the args determine the exact behavior of the command. The following commands are possible for frame widgets: pathName cget option Returns the current value of the configuration option given by option. Option may have any of the values accepted by the labelframe command. pathName configure ?option? ?value option value ...? Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the labelframe command. BINDINGS
When a new labelframe is created, it has no default event bindings: labelframes are not intended to be interactive. EXAMPLE
This shows how to build part of a GUI for a hamburger vendor. The labelframe widgets are used to organize the available choices by the kinds of things that the choices are being made over. grid [labelframe .burger -text "Burger"] [labelframe .bun -text "Bun"] -sticky news grid [labelframe .cheese -text "Cheese Option"] [labelframe .pickle -text "Pickle Option"] -sticky news foreach {type name val} { burger Beef beef burger Lamb lamb burger Vegetarian beans bun Plain white bun Sesame seeds bun Wholemeal brown cheese None none cheese Cheddar cheddar cheese Edam edam cheese Brie brie cheese Gruyu00e8re gruyere cheese "Monterey Jack" jack pickle None none pickle Gherkins gherkins pickle Onions onion pickle Chili chili } { set w [radiobutton .$type.$val -text $name -anchor w -variable $type -value $val] pack $w -side top -fill x } set burger beef set bun white set cheese none set pickle none SEE ALSO
frame(n), label(n), ttk::labelframe(n) KEYWORDS
labelframe, widget Tk 8.4 labelframe(n)
All times are GMT -4. The time now is 08:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy