Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Regular expression with multiple lines

by choroba (Abbot)
on Sep 25, 2013 at 08:25 UTC ( #1055633=note: print w/ replies, xml ) Need Help??


in reply to Regular expression with multiple lines

There must be something else going on. I tested your second code and it works for me:

#!/usr/bin/perl use warnings; use strict; my $content = 'Fields of activity: Legal basis:'; my $d_fieldofactivity = 'missing'; if ($content =~ /Fields \s of \s activity: (.*) Legal/xs) { $d_fieldofactivity = $1; } print "(( $d_fieldofactivity ))\n";

Output:

(( ))
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Regular expression with multiple lines
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055633]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2014-10-23 00:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (122 votes), past polls