regexp help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting regexp help
# 1  
Old 04-06-2008
regexp help

I'd like to know if there is a catchall line for renaming the following patterns:

s01e03 -> 01x03
s4e9 -> 04x09
s10e08 ->10x08

and possibly even:
318 -> 03x18
1002 ->10x02
if its the first 3 or first digit number in the string.

thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

A Regexp You Can Use Everywhere

¯\_(ツ)_/¯ bakunin (0 Replies)
Discussion started by: bakunin
0 Replies

2. Shell Programming and Scripting

Regexp

I would like to extract "1333 Fairlane" given the below text. The word "Building:" is always present. The wording between Building and the beginning of the address can be almost anything. It appears the the hyphen is there most of the time. Campus: Fairlane Business Park Building:... (9 Replies)
Discussion started by: bbaker@copesan.
9 Replies

3. Shell Programming and Scripting

A help in regexp and grep

I have test string value , something like the one below str='KUAMRJIT|GHOSH' If I type echo $str | grep -o -e '\|+' it doesnt give me anything . But on the contrary echo $str | grep -o -e '|' display the only one pipe character(|) thats there in the string above . The way I understood Unix... (8 Replies)
Discussion started by: kumarjt
8 Replies

4. Shell Programming and Scripting

Perl regexp help

Hi, I have file like below: 1|1212|34353|5fdf 6575||dfgdg sfsdf |afsf||4|aasfbc|~1213~~~~~ 1|1212|34353|5fdf 6575||dfgdg sfsdf |affsf| |4|abc|~rwarw~~asa~~~123~312313 1|1212|34353|5fdf 6575||dfgdg sfsdf |afasfs||4|aasfdbc|~564564~~~~ 1|1212|34353|5fdf 6575||dfgdg sfsdf... (1 Reply)
Discussion started by: sol_nov
1 Replies

5. Shell Programming and Scripting

Regexp tip

Hello, I'm just starting working on it. I'd like to get a tip For istance if I have a file like: a b c d e f .... and I wanna get: 1a & 2b & 3c 0d & 8e & 4f ..... I would like to use sed and come up with a regular expression that works.... (3 Replies)
Discussion started by: Dedalus
3 Replies

6. Shell Programming and Scripting

matching regexp

Hi, maybe it is stupid question, but is it possible to match expression like this ? : ... // ... ( there is "//" somewhere on the line and on the end of the line there ISN'T "*/" ) I've tried something like : (in SED) sed 's/\/\/' but I need "*/" not to be on the end of the line ...... (2 Replies)
Discussion started by: kolage
2 Replies

7. UNIX for Dummies Questions & Answers

print the line immediately after a regexp; but regexp is a sentence

Good Day, Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp. sed -n '/regexp/{n;p;}' filename What if my regexp is 3 word or a sentence. Im... (3 Replies)
Discussion started by: ownins
3 Replies

8. Shell Programming and Scripting

Help with regexp

Hi there! I would like to know how to find and replace all numbers in a *.html file and make them bold. Any help will be appreciated! :) (7 Replies)
Discussion started by: agasamapetilon
7 Replies

9. Shell Programming and Scripting

perl regexp

What is the easiest way to get full address of *.jpg images from html file using perl? example: http://farm3.static.flickr.com/2397/2126443111_65a810004c.jpg (1 Reply)
Discussion started by: mirusnet
1 Replies

10. UNIX for Advanced & Expert Users

regexp

Hi guys, does anyone know how to test for a regular expression - i want to include it in a script to make sure the variable is a regexp cheers (1 Reply)
Discussion started by: penfold
1 Replies
Login or Register to Ask a Question
GRCAT(1)						      General Commands Manual							  GRCAT(1)

NAME
grcat - read from standard input, colourise it and write to standard output SYNOPSIS
grcat configuration DESCRIPTION
configuration is a name of a configuration file. Directories ~/.grc/, /usr/local/share/grc/, /usr/share/grc/ are searched for the file (in this order). If the file is not found, it is assumed to be an absolute path of a configuration file located elsewhere. Configuration file consists of entries, one per regexp, entries are separated with lines with first character non-alphanumeric (except #). Lines beginning with # or empty lines are ignored. Each entry consists of several lines. Each line has form: keyword=value where keyword is one of: regexp, colours, command, skip, count. Only regexp is mandatory, but it does not have much sense by itself unless you specify at least a colour or command keyword as well. regexp is the regular expression to match colours is the list of colours, separated by commas (you can specify only one colour), each colour per one regexp group specified in reg- exp. command is command to be executed when regexp matches. Its output will be mixed with normal stdout, use redirectors ( >/dev/null) if you want to supress it. skip can be either yes, or no, if yes, the matched line will be skipped and not displayed in output. Default is no. count is one of words: once, more, or stop. once means that if the regexp is matched, its first occurrence is coloured and the program will continue with other regexp's. more means that if there are multiple matches of the regexp in one line, all of them will be coloured. stop means that the regexp will be coloured and program will move to the next line (i.e. ignoring other regexp's) Regular expressions are evaluated from top to bottom, this allows nested and overlapped expressions. (e.g. you colour everything inside parentheses with one colour, and if a following expression matches the text inside parentheses, it will be also coloured) OPTIONS
None so far. SEE ALSO
grc(1) AUTHOR
Written by Radovan Garabik <garabik @ kassiopeia.juls.savba.sk> GRCAT(1)