Sponsored Content
Top Forums Shell Programming and Scripting Perl Regular Expression - Whitelist Post 90044 by mh53j_fe on Thursday 17th of November 2005 05:22:16 PM
Old 11-17-2005
Response to reggie

Reggie,

Sorry, but that is not the problem. The problem is that the regular expression is not seeing the forward slash (/).

For example, the following string should evaluate to 'good data'.

$variable = 'RWD/FWD';
if ( $variable =~ /^[a-zA-Z0-9\/]*$/ )
#allow alphanumeric and fwd slash only
{
$returnValue = 'good data';
}
else
{
$returnValue = 'Bad Data';
}
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regular expression help in perl

Hi all, I am trying to match a multi line string and return the matching string in one line. Here is the perl code that I wrote: #!/usr/bin/perl my $str='<title>My title</title>'; if ($str =~ /(<title>)(+)(<\/title>)/ ){ print "$2\n"; } It returns : My title I want the... (3 Replies)
Discussion started by: sdubey
3 Replies

2. Shell Programming and Scripting

perl regular expression

letz say that my file has 7 records with only one field. So my file has: 11111111 000000000000000 1111 aaaabbbccc 1111111222000000 aaaaaaaa zz All i need is: 1. when the field has a repetition of the same instance(a-z or 0-9), i would consideer it to be invalid.... (1 Reply)
Discussion started by: helengoldman
1 Replies

3. Shell Programming and Scripting

perl regular expression

Dear all, I have a simple issue on a perl regular expression. I want to get the characters in red from the next lines : POWER_key LEFT_key RIGHT_key OK_key DOWN_key and so on... Thanks in advance for reply. Ludo (1 Reply)
Discussion started by: lsaas
1 Replies

4. Shell Programming and Scripting

Regular expression in Perl

Hi, I need and expression for a word like abc_xyz_ykklm The expresion should indicate that the word starts with abc and end with ykklm but does not contain xyz string in the middle. Example: abc_tmn_ykklm is ok and abc_xyz_ykklm is not Ok. Please help. Regards. (1 Reply)
Discussion started by: asth
1 Replies

5. Shell Programming and Scripting

Perl Regular Expression

Hello, I am trying to use perl LWP module to read and get a specfic URL page. The issue is that the URL ends with the data and time and time is not consistent it changes all the time. if anyone could help me how to write a regular expressin that would work in the LWP::UserAgent get function to... (0 Replies)
Discussion started by: bataf
0 Replies

6. Shell Programming and Scripting

Perl regular expression and %

Could you help me with this please. This regular expression seems to match for the wrong input #!/usr/bin/perl my $inputtext = "W1a$%XXX"; if($inputtext =~ m/+X+/) { print "matches\n"; } The problem seems to be %. if inputtext is W1a$XXX, the regex doesnot match.... (5 Replies)
Discussion started by: suppandi7
5 Replies

7. Shell Programming and Scripting

Hidden Characters in Regular Expression Matching Perl - Perl Newbie

I am completely new to perl programming. My father is helping me learn said programming language. However, I am stuck on one of the assignments he has given me, and I can't find very much help with it via google, either because I have a tiny attention span, or because I can be very very dense. ... (4 Replies)
Discussion started by: kittyluva2
4 Replies

8. Shell Programming and Scripting

Perl regular expression help!

Hi I am doing something basic like... if ($stringvariable =~ /have not typed/) I have a little problem because the 'not' in the expression gets highlighted as a kind of a '!'..what am I supposed to do in this situation? Thank you ---------- Post updated at 03:24 PM ----------... (1 Reply)
Discussion started by: vas28r13
1 Replies

9. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

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)
Discussion started by: jessy83
1 Replies

10. Shell Programming and Scripting

Perl regular expression

Hi , I have the below array my @actionText = ("delivered to governor on 21/23/3345" , "deliver jllj" , "ram 2345/43"); When i am trying to grep the contents of array and if mathced substituting with the digitis or some date format from the element like below my @action = grep { $_ =~... (7 Replies)
Discussion started by: ragilla
7 Replies
exc_resume(3)						     Library Functions Manual						     exc_resume(3)

NAME
exc_resume, exc_longjmp, exc_capture_context, exc_continue, exc_unwind, RtlUnwindRfp - entry points that support resuming execution of user code. LIBRARY
Exception Handling Library (libexc.a) SYNOPSIS
#include <excpt.h> void exc_resume( PCONTEXT contextRecord); void exc_longjmp( PCONTEXT contextRecord, long returnValue); unsigned long exc_capture_context( PCONTEXT contextRecord); void exc_continue( PCONTEXT contextRecord); void exc_unwind( void TargetFrame, void TargetIp, system_exrec_type *exceptionRecord, long returnValue); void RtlUnwindRfp( void *TargetRealFrame, void *TargetIp, system_exrec_type *exceptionRecord, long returnValue); PARAMETERS
Pointer to a struct sigcontext (see signal(2)) used to represent a procedure's context. Value to be passed to the continuing code at the completion of the unwind. If nonzero, virtual frame pointer of the target procedure invocation to which the unwind is to be done; if zero, specifies that an exit unwind is to be initiated and causes the EXCEPTION_EXIT_UNWIND flag to be set in the exception record. If TargetRe- alFrame is nonzero, address within the target invocation at which to continue execution; otherwise this parameter is ignored. Address of primary exception record. If nonzero, real frame pointer of the target procedure invocation to which the unwind is to be done; if zero, specifies that an exit unwind is to be initiated and causes the EXCEPTION_EXIT_UNWIND flag to be set in the exception record. DESCRIPTION
exc_resume and exc_continue perform essentially the same operation as longjmp(3). The exc_resume function is a libexc entry point. exc_capture_context saves the current procedure context in the struct sigcontext identified by contextRecord. exc_longjmp restores the context that was saved by a previous call to exc_capture_context and calls exc_unwind, setting up its arguments from information taken from the contextRecord argument. If the returnValue argument is 0 (zero), it is set to 1 (one) before the call. exc_unwind initiates an unwind of procedure call frames. It sets the EXCEPTION_UNWINDING flag in the exception flags of the exception record, which describes the machine state at the time of the exc_unwind call. If the TargetFrame argument is zero, then exc_unwind also sets the EXCEPTION_EXIT_UNWIND flag. It then scans the procedure call frames towards the base of the call stack to find the target of the unwind operation. RtlUnwindRfp is similar to exc_unwind except that its first argument is a real frame pointer instead of a virtual frame pointer. Real frame pointers point to the bottom of the statically allocated portion of a stack frame. Virtual frame pointers point to the top of the stack frame. As it encounters each frame, the unwind code determines the program counter where control left the corresponding function by looking at exception handler information in the runtime function table built by the linker. If the respective routine has an exception handler, then the unwind code calls it. This handler should perform cleanup code required for that activation. Programs written in the C programming language, which supports structured exception handling, usually contain a try...finally block that implements a termination handler that performs these chores (see c_excpt(4)). The unwind code also calls a handler when it reaches the TargetFrame so that any scope-oriented cleanup code or termination handler can execute. In this case, it sets the EXCEPTION_TARGET_FRAME flag in the ExceptionFlags field of the exception record. Once it finds the TargetFrame (if specified) and calls its handler (if available), exc_unwind: sets the PC to the TargetIp sets the return value to be the returnValue argument, if the returnValue argument is non-zero, sets the return value to be the ExceptionCode of the excep- tion record if the returnValue argument is zero calls exc_continue RETURN VALUES
The exc_capture_context function returns a value of 0 (zero), unless the return is from a call to the exc_longjmp function, in which case exc_capture_context returns the non-zerovalue specified in the returnValue argument to exc_longjmp. The exc_longjmp function cannot return 0 (zero) to the previous context. The value 0 is reserved to indicate the actual return from the exc_capture_context function when first called by the program. If the exc_longjmp function is passed a returnValue parameter of 0, execu- tion continues as if the corresponding call to the exc_capture_context function had returned a value of 1. FILES
usr/ccs/lib/cmplrs/cc/libexc.a - exception handling library usr/include/excpt.h - include file usr/include/pdsc.h - include file usr/include/signal.h - include file usr/include/machine/fpu.h - include file RELATED INFORMATION
Functions: exception_intro(3), exception_dispatcher(3), exc_lookup_function_entry(3), signal(2), sigaction(2), __exc_last_chance(3), ieee(3). Files: excpt(4), c_excpt(4), signal(4), pdsc(4). Assembly Language Programmer's Guide. Calling Standard for Alpha Systems. delim off exc_resume(3)
All times are GMT -4. The time now is 04:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy