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)
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! (0 Replies)
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)
Hi everyone, I would really appreciate any help I could get on the following topic.
I am not very familiar with reg expressions nor with sed, I just know the basic uses. What I am trying to do is the following: I have a huge text file where I would like to replace all occurnces of a certain... (13 Replies)
I need help with a regexp to find out the ip address which can possibly be present in a URL.
The URLs can be in any of the following form
<domain>?a=12345&d=somestring1
<domain>?c=10.10.10.100&d=somestring1
<domain>?a=12345&b=somestring1&c=10.1.2.4d=somestring2... (3 Replies)
I need to change R3.1.5 as 03015
similarly R4.1.7 as 04017
i need a single command
in tcl pls help
---------- Post updated at 05:19 PM ---------- Previous update was at 04:48 PM ----------
i had to do like this without using regexp
set old_release "R3.1.5"
... (1 Reply)
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)
Trying to find and replace one string with another string in a file
#!/usr/bin/perl
$csd_table_path = "/file.ntab";
$find_str = '--bundle_type=021';
$repl_str = '--bundle_type=021 --target=/dev/disk1s2';
if( system("/usr/bin/perl -p -i -e 's/$find_str/$repl_str/' $csd_table_path")... (2 Replies)
regcmp(1) User Commands regcmp(1)NAME
regcmp - regular expression compile
SYNOPSIS
regcmp [-] filename...
DESCRIPTION
The regcmp command performs a function similar to regcmp and, in most cases, precludes the need for calling regcmp from C programs. Bypass-
ing regcmp saves on both execution time and program size. The command regcmp compiles the regular expressions in filename and places the
output in filename.i.
OPTIONS
- If the - option is used, the output is placed in filename.c. The format of entries in filename is a name (C variable) followed by
one or more blanks followed by one or more regular expressions enclosed in double quotes. The output of regcmp is C source code.
Compiled regular expressions are represented as extern char vectors. filename.i files may thus be #included in C programs, or
filename.c files may be compiled and later loaded. In the C program that uses the regcmp output, regex(abc,line) applies the regu-
lar expression named abc to line. Diagnostics are self-explanatory.
EXAMPLES
Example 1: Examples of the regcmp command.
name "([A-Za-z][A-Za-z0-9_]*)$0"
telno "({0,1}([2-9][01][1-9])$0){0,1} *"
"([2-9][0-9]{2})$1[ -]{0,1}"
"([0-9]{4})$2"
The three arguments to telno shown above must all be entered on one line.
In the C program that uses the regcmp output,
regex(telno, line, area, exch, rest)
applies the regular expression named telno to line.
ENVIRONMENT VARIABLES
A general description of the usage of the LC_* environmental variables can be found in environ(5).
LC_CTYPE Determines how regcmp handles characters. When LC_CTYPE is set to a valid value, regcmp can display and handle text and
filenames containing valid characters for that locale.
LC_MESSAGES Determines how diagnostic and informative messages are presented. This includes the language and style of the messages, and
the correct form of affirmative and negative responses. In the "C" locale, the messages are presented in the default form
found in the program itself (in most cases, U.S. English).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWtoo |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
SEE ALSO regcmp(3C), attributes(5), environ(5)SunOS 5.10 Dec 20 1996 regcmp(1)