12-02-2014
The error message is what it says. The lookbehind can not be of variable length. That means in this case that the use of alternation (|) in (?<=^|RR45) is not allowed because the two sides (^ and RR45) are not the same length..
Last edited by Scrutinizer; 12-02-2014 at 04:08 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
from the gnu sed manual, I should be able to do this:
`\(REGEXP\)'
Groups the inner REGEXP as a whole, this is used to:
* Apply postfix operators, like `\(abcd\)*': this will search
for zero or more whole sequences of `abcd', while `abcd*'
... (3 Replies)
Discussion started by: Allasso
3 Replies
2. Shell Programming and Scripting
Hi there, I need to test that a variable ($VAR) matches a regex mask in BASH. I have the exact thing working in perl (below), but could somebody advise me how i would do the same in BASH ? do i need to use something like egrep ?
#!/bin/perl -w
my $VAR = "some value";
if ( $VAR =~... (4 Replies)
Discussion started by: rethink
4 Replies
3. Shell Programming and Scripting
Why is only hello3 being printed? There must be some kind of syntax problem because the file list definitely includes all the file extensions line by line.
#!/bin/bash
find '/home/myuser/folder/' -name '*.c' -type f | while read F
do
if ] # if the file name ends in .txt.c
then
... (6 Replies)
Discussion started by: cyler
6 Replies
4. Shell Programming and Scripting
I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly:
if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies
5. Shell Programming and Scripting
Hi,
I'm trying to validate if a string matches a regular expression, but it is not working. Am I missing something? Do I need to scape any of the characters?
if echo 'en-GB' | egrep '({1,8})(-{1,8})*' >/dev/null; then
echo Valid value
fi
Thanks in advance (6 Replies)
Discussion started by: skrtxao
6 Replies
6. Shell Programming and Scripting
Hi ,
I am trying to extract contents of a file between specified time stamp. but it does not seem to work. i am trying to extract output of /var/adm/messages between 15:00:00 to 15:23:59 .
i have tried two regex the first one seems to kind of work. it displays some output. the second one is... (13 Replies)
Discussion started by: chidori
13 Replies
7. UNIX for Dummies Questions & Answers
I have a number of files that I pass through awk/gsub.
I believe to have found a working regex and on 'test bed' sites it matches, however within gsub it does not.
Examples:
Initial data:
/Volumes/Daniel/Public/Drop Box/_Hellsing_Ultimate_OVA_-_10_.mkv
gsub & regex:
gsub("\]+\]",""
... (4 Replies)
Discussion started by: unknownn
4 Replies
8. Shell Programming and Scripting
Using BASH:
$ if -- ::00" ]]; then echo "true"; else echo "false"; fi
false
Mike (5 Replies)
Discussion started by: Michael Stora
5 Replies
9. Shell Programming and Scripting
I am using a regex to exactly match a string abcdef as ^abcdef$. But it does'nt seem to work :( (11 Replies)
Discussion started by: gaurav99
11 Replies
10. Shell Programming and Scripting
I am not a big expert in regex and have just little understanding of that language.
Could you help me to understand the regular Perl expression:
^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{
------
This is regex to select functions from a C/C++ source and defined in... (2 Replies)
Discussion started by: alex_5161
2 Replies