Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Generate a truth table from input string

by Anonymous Monk
on May 13, 2008 at 15:07 UTC ( [id://686290]=note: print w/replies, xml ) Need Help??


in reply to Re: Generate a truth table from input string
in thread Generate a truth table from input string

the problem that i am facing is, NOT is represented by both ! and ', variables could be !(A)+!(B)+!(C) or A'+B'+C', both mean the same. how do i do it?
  • Comment on Re^2: Generate a truth table from input string

Replies are listed 'Best First'.
Re^3: Generate a truth table from input string
by psini (Deacon) on May 13, 2008 at 15:12 UTC

    s/(\w+)'/!\1/g

    Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.
      or as use warnings; would say...
      \1 better written as $1

      and use diagnostics; would elaborate...

      (W syntax) Outside of patterns, backreferences live on as variable +s. The use of backslashes is grandfathered on the right-hand side of +a substitution, but stylistically it's better to use the variable fo +rm because other Perl programmers will expect it, and it works better + if there are more than 9 backreferences.
      Is (a+b)' disallowed?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-19 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found