Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: Re: Re: Re: conditional match in regex

by petral (Curate)
on Nov 06, 2002 at 14:58 UTC ( #210747=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: conditional match in regex
in thread conditional match in regex

The problem seems to be stated: either $val or <val>:
$ perl -le'$_=pop;/([\$@*%]|(<))(.*)(?(2)>)/;print"($1)($3)"' '$xyz' ($)(xyz) $ perl -le'$_=pop;/([\$@*%]|(<))(.*)(?(2)>)/;print"($1)($3)"' '$xyz>' ($)(xyz>) $ perl -le'$_=pop;/([\$@*%]|(<))(.*)(?(2)>)/;print"($1)($3)"' '<xyz>' (<)(xyz)


  p

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: conditional match in regex
by jryan (Vicar) on Nov 06, 2002 at 16:19 UTC
    '$xyz>' is definately NOT a valid symbol table entry.
      Right.  I was just showing how the regex works.
      $ perl -le'"%xyz"=~/([\$@*%]|(<))(.*)((?(2)>))/;print"($1)($3)($4)"' (%)(xyz)() $ perl -le'"%xyz>"=~/([\$@*%]|(<))(.*)((?(2)>))/;print"($1)($3)($4)"' (%)(xyz>)() $ perl -le'"<xyz>"=~/([\$@*%]|(<))(.*)((?(2)>))/;print"($1)($3)($4)"' (<)(xyz)(>)

        p

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2020-05-27 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (162 votes). Check out past polls.

    Notices?