There are 4 major sections. The red '^' at the beginning 'anchors' the pattern to the beginning of the data. The expression will only evaluate to true if the first character of the pattern is the first character of the data.
The red '$' at the end is also an anchor which anchors the match to the end of the data. The expression will evaluate to true only if the last character of the matched string is the last character of the data.
There are two major sections in between (blue and black). The blue section consists of a group which is contained within parens. Within the group are pipe '|' separated fields; the pipe indicates an OR condition such that the pattern is considered a match when any single field's expression is true.
The blue group contains a set of 4 fields which will evaluate to true when the chararacters at the beginning
of the string match:
The second section (black) contains a nested group. The inner group is similar to the blue group. The first number is allowed to be 0 even if a single digit, and the set of up to three digits must be preceded with a dot. There is a backslant (\) in front of the dot because the dot has special meaning and to indicate that a true (real) dot is to be matched it must be escaped.
The outer set of parens in the second group is followed by {3} which is a repetition operator that affects the adjacent group. The 3 indicates that this pattern must exist exactly three times.
I haven't completely vetted it, but it appears that the intent is to match an IP address.
Hi,
I am quite knew to scripting and I am trying to get a regular expression to work to check that a user enters a valid version number such as 1 or 1.1 or 12.3 etc. I dont seem to be able to get it to work as it picks up versions such as 1.......2. I only want it to work with a single dot.... (12 Replies)
Hello All,
I'm trying to extract the lines between two consecutive elements of an array from a file.
My array looks like:
problem_arr=(PRS111 PRS213 PRS234)
j=0
while } ]
do
k=`expr $j + 1`
sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt
---some operation goes... (11 Replies)
Hi all,
How am I read a file, find the match regular expression and overwrite to the same files.
open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat";
open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat";
while (<DESTINATION_FILE>)
{
# print... (1 Reply)
CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error.
source $CA_VERSION_DATA
if * ]
then
echo "CA_RELESE $CA_RELEASE is invalid"
exit -1
fi
+ source /etc/ncgl/ca_version_data
++ CA_PRODUCT_ID=samxts
++ CA_RELEASE=6
++ CA_WEEK_NO=7
++... (3 Replies)
hi all,
i have a text file with below content
...............................
...............................
...............................
...............................
%%Page: (4) 4
%%PageBoundingBox: 34 -30 584 831
%%BeginPageSetup
%%BeginFeature: *PageSize A4
595 842... (7 Replies)
Hi all,
I'm working with flex (version 2.5.4a) on GNU/linux. I need to frame a regular expression which would match cases where word "file" does not occur. Negated character class wont work for me because they enforce "or" clause between different chars (so something like wont work). I would like... (5 Replies)
I have a file with data that looks like -
record nullable { final_delim=end ,delim="~%%~" ,quote=none }
(
1_UPC:string;
2_QUANTITY:string;
)
I want to fetch the first column that starts with integer. e.g - 1_UPC, 2_QUANTITY.
I tried "awk -F ":" -v var1="^0-9" '$1==var1' inschemafile".... (2 Replies)
Is it possible to combine a regular expression with a aritmetical expression? For example, taking a 8-numbers caracter sequece and casting each output of a grep, comparing to a constant.
THX! (2 Replies)