what does this match for?

I saw a Regex:

(?i:(j?sessionid|(php)?sessid|(asp|jserv|jw)?session[-_]?(id)?|cf(id|token)|sid))


I especially didn't know what the leading "?i:" means.
Please help, thanks!
0
practicalperl
2/12/2009 3:46:01 AM
perl.beginners 29388 articles. 4 followers. Follow

3 Replies
578 Views

Similar Articles

[PageSpeed] 40
Get it on Google Play
Get it on Apple App Store

practicalperl@gmail.com wrote:
> I saw a Regex:
> 
> (?i:(j?sessionid|(php)?sessid|(asp|jserv|jw)?session[-_]?(id)?|cf(id|token)|sid))
> 
> 
> I especially didn't know what the leading "?i:" means.
> Please help, thanks!

The /i option means that everything inside the parentheses is a case 
insensitive pattern.


John
-- 
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov
0
jwkrahn
2/12/2009 3:54:57 AM
practicalperl@gmail.com wrote:

> I saw a Regex:
> 
> (?i:(j?sessionid|(php)?sessid|(asp|jserv|jw)?session[-_]?(id)?|cf(id|token)|sid))
> 
> 
> I especially didn't know what the leading "?i:" means.

It is a modifier, see perlre.

-- 
Ruud
0
rvtol
2/12/2009 9:27:34 AM
On Feb 11, 7:46=A0pm, practicalperl@gmail.com wrote:
> I saw a Regex:
>
> (?i:(j?sessionid|(php)?sessid|(asp|jserv|jw)?session[-_]?(id)?|cf(id|toke=
n)|sid))
>
> I especially didn't know what the leading "?i:" means.
> Please help, thanks!

So, ... isn't this much more readable:

(?ix:
    (
        j?sessionid
        |
        (php)?sessid
        |
        (asp|jserv|jw)?session[-_]?(id)?
        |
        cf(id|token)
        |
        sid
    )
)

0
michael1cat
2/17/2009 2:33:16 AM
Reply:

Similar Artilces:

match not matching
Can somebody help me understand this? Given this loop, and the logged output following ... my $found; for( @$products ) {; $found = $$_ =~ m|$project|; $dump = Data::Dumper->Dump([$_, $project, $$_, $found]); $logger->trace(qq(dump=$dump)); } I can't explain why $found is not true on the 3rd pass. Does this have something to do with the way I'm dereferencing the blessed object? SVN.Hooks - dump=$VAR1 = bless( do{\(my $o = 'FS1100-S1')}, 'RPC::XML::string' ); $VAR2 = 'STABLE/FS1100-S3/RSLOGIX_5000/'; $VAR3 = 'FS1100-S1'...

[perl6/specs] 8efa3a: Correct Match.start/Match.end -> Match.from/Match....
----==_mimepart_51421864a530e_53794451388849a Date: Thu, 14 Mar 2013 11:35:16 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: <51421864aceb8_537944513888528@hookshot-fe6-pe1-prd.aws.github.net.mail> Branch: refs/heads/master Home: https://github.com/perl6/specs Commit: 8efa3ac10649401dbbcb6488975bc65d6b501326 https://github.com/perl6/specs/commit/8efa3ac10649401dbbcb6488975bc65d6b501326 Author: Rob Hoelz <rob@hoelz.ro> Date: 2013-03-14 (Thu, 14 Mar 2013) Changed paths: M S28-spe...

howto simplfy this regex if ($string =~/^$match | $match | $match$/g){
------=_NextPart_000_004C_01C8ADE9.8884D110 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Hi, How do I simplify the regex below so that it matches only the number 1, = henceforth it should return false if I match $string with $match. use strict; use warnings; my $string =3D "10 11 12 13 40"; my $match =3D 1; if ($string =3D~/^$match | $match | $match$/g){ print "match"; }else{ print "unmatch"; }; ------=_NextPart_000_004C_01C8ADE9.8884D110-- On Sun, May 4, 2008 at 1:19 AM, &l...

Beginner of Beginner getting an error
Hi Guys, I have this script: #!/usr/bin/perl # track, find email addresses in emails, # writes them to /var/opt/ITrootmail/bad/ with a date # set up as a pipe for procmail or use with Pine $now = `date`; # find included email-like addresses while ($line = <STDIN>) { if ($line =~ /\b([\w_\-\.]+ at [\w_\-\.]+)\b/) { # exclude email addresses not needed (next) if ( $1 =~ /\d{8,}/ ); (next) if ( $1 =~ /postmaster/i ); (next) if ( $1 =~ /DAEMON/i ); ...

match
Using ASA8 PB8.03 I am dev a jpn app where they use MS IME JPN input which can be defined as half width characters or full width characters something like (a s d d or asddfff) How can I force a validation rule to accept only half width katakana? something like; @columnA= halfwidth kana(obviously I need to replace the second part) or maybe using the match(string,textpattern) But what is the text pattern??? Is this App running on Japanese Windows? pbm_thisusuallydoesnothelp:-)) Philip Salgannik "Matt" <NoEmail@yahoo.com> wrote in message news:eVab6k2...

match
$mystring3="abacadeusagaka35"; if($mystring =~ m/(a.+)/g){ print $1,"\n"; } Hi, I wonder how to print the "abacad" out? Thanks for any suggestions, Best regards, On Mon, Feb 13, 2012 at 9:48 PM, lina <lina.lastname@gmail.com> wrote: > $mystring3=3D"abacadeusagaka35"; > > if($mystring =3D~ m/(a.+)/g){ Here supposed to be if($mystring3 =3D~ m/(a.)+/) > =A0 =A0 =A0 =A0print $1,"\n"; showed "ad" only @myarray=3D($mystring3 =3D~ m/(a.)+/); print @myarray,"\n"; also showed "a...

match data based on matching field
--Boundary_(ID_qfkdjg6SLYMMz7hVKeTUoA) Content-type: text/plain; charset=Windows-1252 Content-transfer-encoding: 7BIT I work with library cataloguing records and am trying to accomplish this amazing feat. Trying is no problem, amazing feat is eluding me I need to find all records with the same ISBN number (field 020)save all matching records which will result in more than 1 record with the same ISBN, then somehow magically end up with only 1 record containing all 856 fields. We import these record to the database from various vendors, and some titles are exactly the same resultin...

Finding Matching Users... but NOT for a Matching rule
I'm trying to write a create rule that says, "If a user being added has the same first and last name as an existing user, create the user with a "pendingXXX" CN." Then, admins can manually determine if the user should have been matched to a pre-existing record, or if this is indeed just a case of similar names. (For business reasons too complex to cover, I can't implement this in a matching rule and we have to leave the manual reconciliation in place.) I have a piece of XSLT (see below) that queries the directory to find a count of existing users who have...

pivot sql matched matched to a report
I have a query that is a pivot table.   Not only will the column numbers vary but the name of the columns will change to.  This query will not always produce a result with same number of columns.What i want to do is just produce a report that is a "select * from pivot query" that will support multiple columns for diffrent runs of the query.Is this possible? I think to achieve this you would have to use a matrix instead of a table....

Matching
I need to implement matching functionality -- match an entry to a list of valid values -- using soundex and fuzzy principles, et. al. Is there third party code I can buy that handles this? james pelton j-pelton@nwu.edu northwestern university Soundex is supported by Sybase Adaptive Server. James Pelton wrote: > I need to implement matching functionality -- match an entry to a list > of valid values -- using soundex and fuzzy principles, et. al. Is there > third party code I can buy that handles this? > > james pelton > j-pelton@nwu.edu > northwestern u...

Beginner's Beginner
I'm using a Bound Data Grid and want to simply transfer to another webpage and display the details of the record selected in the 1st data grid in a second data grid.  I'm able to define the grid to display the summary field.  Can someone tell me how in the (hopefully) property builder I can call another webpage and pass the selected field and display another data grid with the detail information from another database, the absolute easiest way please? Thanks in advance You need to put what you need in the ItemCommand for the datagrid like below..... Private Sub myD...

matching
Hi! I have wrote the following code: while (<TEMP>) { if(m/(http:\/\/www.01net.com\/rdn?oid=[0-9].*&rub=[0-9].*)/ ) { print TEMP2 "$1\n" ; } } The matching doesn't work ! want to match for example : http://www.01net.com/rdn?oid=54682&rub=12456 Can anybody help me ? Thanks Franck > -----Original Message----- > From: COLLINEAU Franck FTRD/DMI/TAM > [mailto:franck.collineau@rd.francetelecom.com] > Sent: Tuesday, October 02, 2001 11:08 AM > To: Perl (E-mail) > Subject...

matching **
Hi all. Everyone has been so helpful with my other questions, I thought I would put out another one. I'm writing a script that searches through an array of hashes. One of the possible fields in the hash is "Comments" and sometimes the comments have characters such as ? or * in them. Right now, my search line looks like this if ($myhash{$searchVar} =~ /$value/i) { do stuff; } which works fine for regular text, but chokes up if $value is something like ** due to the matching. I know backslashes would help if I knew in advance it would be **, but the user sets t...

Why is this not a match?
Hello All, I am unable to find out why is this not matching: I do have a file where the second line contains: Summary Log (generated: Tue Apr 1 22:02:29 MST 2003) I am processing this file by this script: #!usr/bin/perl -w use strict; use Fcntl qw[:flock]; my $impressions = 0; my $iofile = '/other/scripts/daniel/input/c07_impressions_io.info'; open (IO, $iofile) || die("Could not open file 1!"); while (<IO> ) { chop; (my$FH, my$output, my$file2check, my$month, my$year) = split (/\s+/, $_); open OUT, ">> $output...

Why not match?
--f46d0447f32cb18c2304c066a888 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hello guys, I have a simple code, but it doesn't work and don't know why. Please see it below: Input file: 1.txt which including number and letter "o" in one line. 10o10o10 Wanted output file: 2.txt in which 10 represent 10 dots and o is replaced by letter "x". ..........x..........x..........x The perl code I wrote is below: #!/usr/bin/perl use strict; use warnings; while(<>){ c...

Web resources about - what does this match for? - perl.beginners

Match - Wikipedia, the free encyclopedia
Wooden matches are packaged in matchboxes , and paper matches are partially cut into rows and stapled into matchbooks . The coated end of a match, ...

Match - Wikipedia, the free encyclopedia
Wooden matches are packaged in matchboxes , and paper matches are partially cut into rows and stapled into matchbooks . The coated end of a match, ...

How Did Facebook Buzz About Golden Globes Nominees Match Up With Winners?
... Globes Awards were revealed during the televised ceremony Sunday night, but how did Facebook activity in the week leading up to the event match ...

Cricket Australia raises prospect of day-night Test match in Canberra after Adelaide success
Meanwhile, the ACT Government and Cricket ACT refuse to be drawn into an ugly war of words.

Apple raises iTunes Match iCloud Music Library limit to 100k songs, up from 25k
As promised by Eddy Cue earlier in the year , Apple has now raised the limits on iTunes Match and Apple Music library for matched songs from ...


Match tiles and keep the rhythm going in Bebop Puzzle Beat
Bebop Puzzle Beat Match tiles and keep the rhythm going in Bebop Puzzle Beat is a story by AppAdvice.com AppAdvice - iPhone, iPad, iPod, App ...

Billionaire cage match
Billionaire cage match by digby I've been wondering for some time if it wouldn't just be easier to quit this charade we call "democracy" and ...

Apple Increases iTunes Match, Apple Music iCloud Storage Limit To 100,000 Tracks
... store a lot more of their favorite tunes in the cloud: about 75,000 more songs to be exact. Apple confirmed over the weekend that iTunes Match ...

Scalabrine: Celtics match up well; predicts win vs Golden State
... Login Search form Search 53° Main menu Home Celtics Patriots Red Sox Bruins Revolution More WRITERS Watch Shop NECN Scalabrine: Celtics match ...

Resources last updated: 12/12/2015 1:46:58 PM