Sponsored Content
Full Discussion: RegEX question
Top Forums Shell Programming and Scripting RegEX question Post 302584281 by rider29 on Thursday 22nd of December 2011 03:03:35 PM
Old 12-22-2011
RegEX question

Hi,

I am trying to write a regex for myscript and need some input from experts.

here is what I must grep for

TICKET{Sapce}[3,4,5.. digit number][a comma]{Space}[Two aplhabits]{hyphen}[3,4,5 ..digit number][colon][some text]

so here is the example data

TICKET 34554, CT-12345, TICKET 12345: some text here

TICKET 2342, CT-12345, MA-12344: some text here

TICKET 2345, TICKET 2345, TICKET 2345: some text here

every line starts with TICKET ####

I tried a bit but not able to cover case so far. Please suggest
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

regex question

hi, i got a problem with understanding regular expressions. what i wanna do is scanning the wtmp logfile for ips and if a specific ip is echoed id like to be a part of a text to be assigned to it. the scanning is done with #! /bin/bash cat wtmp | strings | egrep -o "+\.+\.+\." | sort -u... (6 Replies)
Discussion started by: rocketkids
6 Replies

2. Shell Programming and Scripting

regex question

I have a simple file test.out that contains data in the form of key1=A|shift1 key2=B|shift2 key3=C|shift3 and so on. I need to get it to print A B C I can do it using lookbehind assertion such as this ( ?<==)() yet I was wondering if there is another way of mutching single... (8 Replies)
Discussion started by: arushunter
8 Replies

3. Shell Programming and Scripting

regex question

Hi I have a question on regex There is a line in a script like my_file="$(echo SunMonTueWed | sed "s//_&g") " My question what does the expression _&g do. Obviously in this example the output is _Sun_Mon_Tue_Wed Another question can i use some trick to get the result like... (3 Replies)
Discussion started by: xiamin
3 Replies

4. Shell Programming and Scripting

regex question

Hi, im sure this is really simple but i cant quite figure it out. how do i test against a word at the beginning of the line but up to the point of a delimiter i.e. ":" for example if i wanted to test against the user in the /etc/passwd file peter:x:101:100:peters account:/var/peter:/bin/sh ... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

5. Shell Programming and Scripting

Question on regex with * and .

I have a basic question regarding * and . while using regex: # echo 3 | grep ^*$ 3 I think I understood why it outputs "3" here (because '*' matches zero or more of the previous character) but I don't understand the output of the following command: # echo 3 | grep ^.$ # I thought I... (7 Replies)
Discussion started by: mirage
7 Replies

6. UNIX for Dummies Questions & Answers

regex question

I have dates in mm/dd/yy format that I wish to convert to yy-mm-dd format. ()/()/() finds them, but when I try to replace with $3-$1-$2 both kate and kwrite treat it as a text literal. (2 Replies)
Discussion started by: porphyry5
2 Replies

7. Shell Programming and Scripting

regex question

Hi guys, I have a file in the following format: cmpr5551 cmpr6002 cmpr93 anne 5454 bbro 434 cmprsvc cmprsvc7 ffgi55 vefe99 cmprsvc8 cmprsvc9 I need to "grep" only the entries which start with "cmpr" followed by the number. All other entries should be excluded. I was trying to use... (3 Replies)
Discussion started by: aoussenko
3 Replies

8. Shell Programming and Scripting

regex question

Hi guys, I am trying to "grep" or "egrep" the following entry out of the file using regex: MACCDB1 or MACCDB2 The problem is that the file might contain other entries which start with "MACCDB" string. I was trying to use regex to "grep" the exact pattern but it fails to output the correct... (2 Replies)
Discussion started by: aoussenko
2 Replies

9. Shell Programming and Scripting

Regex Question

Hi I am trying to match lines having following string BIND dn="uid= putting something like this is not working : /\sBIND dn="uid=/ Any suggestion. Thanks. John (9 Replies)
Discussion started by: john_prince
9 Replies

10. Shell Programming and Scripting

Regex question

I want to match all occurrence of 01,03,05,07,10,11 at 9th and 10th position of a string . I tried the following but its also matching characters like 33 or 11 on 9th and 10th position . sed "/^\{8\}00/d" A.TXT 000000001000 433483433339 <<< wrong 121121211100 <<< wrong 167710000110... (10 Replies)
Discussion started by: boncuk
10 Replies
RT::Client::REST::Ticket(3pm)				User Contributed Perl Documentation			     RT::Client::REST::Ticket(3pm)

NAME
RT::Client::REST::Ticket -- this object represents a ticket. SYNOPSIS
my $rt = RT::Client::REST->new(server => $ENV{RTSERVER}); # Create a new ticket: my $ticket = RT::Client::REST::Ticket->new( rt => $rt, queue => "General", subject => $subject, )->store(text => "This is the initial text of the ticket"); print "Created a new ticket, ID ", $ticket->id, " "; # Update my $ticket = RT::Client::REST::Ticket->new( rt => $rt, id => $id, priority => 10, )->store; # Retrieve my $ticket => RT::Client::REST::Ticket->new( rt => $rt, id => $id, )->retrieve; unless ($ticket->owner eq $me) { $ticket->steal; # Give me more work! } DESCRIPTION
RT::Client::REST::Ticket is based on RT::Client::REST::Object. The representation allows one to retrieve, edit, comment on, and create tickets in RT. ATTRIBUTES
id This is the numeric ID of the ticket. queue This is the name of the queue (not numeric id). owner Username of the owner. creator Username of RT user who created the ticket. subject Subject of the ticket. status The status is usually one of the following: "new", "open", "resolved", "stalled", "rejected", and "deleted". However, custom RT installations sometimes add their own statuses. priority Ticket priority. Usually a numeric value. initial_priority final_priority requestor This is the attribute for setting the requestor on ticket creation. If you use requestors to do this in 3.8, the recipient may not receive an autoreply from RT because the ticket is initially created as the user your REST session is connected as. It is a list attribute (for explanation of list attributes, see LIST ATTRIBUTE PROPERTIES in RT::Client::REST::Object). requestors This contains e-mail addresses of the requestors. It is a list attribute (for explanation of list attributes, see LIST ATTRIBUTE PROPERTIES in RT::Client::REST::Object). cc A list of e-mail addresses used to notify people of 'correspond' actions. admin_cc A list of e-mail addresses used to notify people of all actions performed on a ticket. created Time at which ticket was created. Note that this is an immutable field and therefore the value cannot be changed.. starts started due resolved told time_estimated time_worked time_left last_updated DB METHODS
For full explanation of these, please see "DB METHODS" in RT::Client::REST::Object documentation. retrieve Retrieve RT ticket from database. store ([text => $text]) Create or update the ticket. When creating a new ticket, optional 'text' parameter can be supplied to set the initial text of the ticket. search Search for tickets that meet specific conditions. TICKET-SPECIFIC METHODS comment (message => $message, %opts) Comment on this ticket with message $message. %opts is a list of key-value pairs as follows: attachments List of filenames (an array reference) that should be attached to the ticket along with the comment. cc List of e-mail addresses to send carbon copies to (an array reference). bcc List of e-mail addresses to send blind carbon copies to (an array reference). correspond (message => $message, %opts) Add correspondence to the ticket. Takes exactly the same arguments as the comment method above. attachments Get attachments associated with this ticket. What is returned is an object of type RT::Client::REST::SearchResult which can then be used to get at objects of type RT::Client::REST::Attachment. transactions Get transactions associated with this ticket. Optionally, you can specify exactly what types of transactions you want listed, for example: my $result = $ticket->transactions(type => [qw(Comment Correspond)]); Please reference RT::Client::REST documentation for the full list of valid transaction types. Return value is an object of type RT::Client::REST::SearchResult which can then be used to iterate over transaction objects (RT::Client::REST::Transaction). take Take this ticket. If you already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. untake Untake this ticket. If Nobody is already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. steal Steal this ticket. If you already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. CUSTOM FIELDS
This class inherits 'cf' method from RT::Client::REST::Object. To create a ticket with a bunch of custom fields, use the following approach: RT::Client::REST::Ticket->new( rt => $rt, # blah blah cf => { 'field one' => $value1, 'field two' => $another_value, }, )->store; Some more examples: # Update a custom field value: $ticket->cf('field one' => $value1); $ticket->store; # Get a custom field value: my $another value = $ticket->cf('field two'); # Get a list of ticket's custom field names: my @custom_fields = $ticket->cf; INTERNAL METHODS
rt_type Returns 'ticket'. SEE ALSO
RT::Client::REST, RT::Client::REST::Object, RT::Client::REST::Attachment, RT::Client::REST::SearchResult, RT::Client::REST::Transaction. AUTHOR
Dmitri Tikhonov <dtikhonov@yahoo.com> LICENSE
Perl license with the exception of RT::Client::REST, which is GPLed. perl v5.14.2 2012-01-20 RT::Client::REST::Ticket(3pm)
All times are GMT -4. The time now is 11:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy