Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^6: Internal representation of qr//: and what is: "(?^u:" ?

by HelenCr (Monk)
on Oct 13, 2012 at 07:35 UTC ( #998822=note: print w/replies, xml ) Need Help??


in reply to Re^5: Internal representation of qr// compiled regular expressions
in thread Internal representation of qr// compiled regular expressions

And what is: '(?^u:' ?

When inspecting (using the EPIC/Eclipse Perl debugger) the internal composition of a compiled regex (for example:

my $var = qr/abc/;

then $var shows as:

 '(?^u:abc)'

What is '(?^u:' ?

Replies are listed 'Best First'.
Re^7: Internal representation of qr//: and what is: "(?^u:" ?
by Athanasius (Chancellor) on Oct 13, 2012 at 08:25 UTC

    From Extended Patterns:

    (?^alupimsx)
    One or more embedded pattern-match modifiers, to be turned on (or turned off, if preceded by -) for the remainder of the pattern or the remainder of the enclosing pattern group (if any).

    and

    Starting in Perl 5.14, a "^" (caret or circumflex accent) immediately after the "?" is a shorthand equivalent to d-imsx.

    So, (?^u:abc) is shorthand for (?du-imsx:abc), which means (see Modifiers), match the string abc with:

    • /d    “the old, problematic, pre-5.14 Default character set behavior”;
    • /u    using the Unicode character set;
    • -i    with case-sensitive pattern matching;
    • -m    the string not treated as multiple lines ("^" and "$" match at the start or end, respectively, of the string);
    • -s    the "." pattern not matching the newline character; and
    • -x    whitespace and comments treated as patterns to be matched.

    Hope that helps,

    Athanasius <°(((><contra mundum

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998822]
help
Chatterbox?
[ambrus]: (Also a lot of manual intervention by two or three other co-workers, who do other parts of the process.)
[ambrus]: Some of the manual part is unavoidable, but not all.
[choroba]: LanX was there a way to recover the numbers from the remaining information?
[Corion]: LanX: Ow ;)
Discipulus manual work: i just tell the same to my boss: every time the quick solution is to assign some manual data entry task to my group.. because we have not direct access to many databases here..
[LanX]: point is: in high speed trade each bank has to remember what he has to get from the others... so dresdner got billed for losses but couldn't claim gains
Discipulus is this the IT?
[Corion]: Discipulus: Well, in many cases it doesn't make sense to build an interface and complicated program just to enter 20 rows into a database ;) But yes, automating data imports should pay off in the long run
[LanX]: Choroba: this happened before I joined, was still in uni, but my boss was summoned to the CEO of the second biggest German bank at that time and could only say " I told them its not ready" ;)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2017-03-29 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (350 votes). Check out past polls.