Skip to main content
deleted 70 characters in body
Source Link
Jarmex
  • 3.7k
  • 15
  • 20

Perl, 64 63 bytes

62b code + 1 command line (-p)

Not amazing at the moment, but I'll continue to try to shorten it.

s/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g

Usage example:

echo "1 + 2x + 3x^2" | perl -pe 's/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g'

Thanks Denis for -1b

Perl, 64 63 bytes

62b code + 1 command line (-p)

Not amazing at the moment, but I'll continue to try to shorten it.

s/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g

Usage example:

echo "1 + 2x + 3x^2" | perl -pe 's/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g'

Thanks Denis for -1b

Perl, 64 63 bytes

62b code + 1 command line (-p)

s/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g

Usage example:

echo "1 + 2x + 3x^2" | perl -pe 's/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g'

Thanks Denis for -1b

edited body
Source Link
Jarmex
  • 3.7k
  • 15
  • 20

Perl, 6364 6263 bytes

62b code + 1 command line (-p)

Not amazing at the moment, but I'll continue to try to shorten it.

s/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g

Usage example:

echo "1 + 2x + 3x^2" | perl -pe 's/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g'

Thanks Denis for -1b

Perl, 63 62 bytes

62b code + 1 command line (-p)

Not amazing at the moment, but I'll continue to try to shorten it.

s/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g

Usage example:

echo "1 + 2x + 3x^2" | perl -pe 's/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g'

Thanks Denis for -1b

Perl, 64 63 bytes

62b code + 1 command line (-p)

Not amazing at the moment, but I'll continue to try to shorten it.

s/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g

Usage example:

echo "1 + 2x + 3x^2" | perl -pe 's/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g'

Thanks Denis for -1b

added 26 characters in body
Source Link
Jarmex
  • 3.7k
  • 15
  • 20

Perl, 6363 62 bytes

62b code + 1 command line (-p)

Not amazing at the moment, but I'll continue to try to shorten it.

s/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g

Usage example:

echo "1 + 2x + 3x^2" | perl -pe 's/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g'

Thanks Denis for -1b

Perl, 63 bytes

62b code + 1 command line (-p)

Not amazing at the moment, but I'll continue to try to shorten it.

s/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g

Usage example:

echo "1 + 2x + 3x^2" | perl -pe 's/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g'

Perl, 63 62 bytes

62b code + 1 command line (-p)

Not amazing at the moment, but I'll continue to try to shorten it.

s/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g

Usage example:

echo "1 + 2x + 3x^2" | perl -pe 's/(\d+)x.(\d+)/$1*$2."x^".($2-1)/eg;s/\^1\b|^\d+ . |x(?!\^)//g'

Thanks Denis for -1b

deleted 2 characters in body
Source Link
Jarmex
  • 3.7k
  • 15
  • 20
Loading
Source Link
Jarmex
  • 3.7k
  • 15
  • 20
Loading