A
A
Alexey Medvedev2014-08-15 17:23:30
Perl
Alexey Medvedev, 2014-08-15 17:23:30

How to remove the first 22 characters in a string (Perl)?

I can't solve a simple problem in Perl, since I've encountered it for the first time. There is a line of text, with numbers, letters and signs. You just need to remove the first 22 characters. This construction doesn't work:
$ps_text =~s/^{22}//g;
UPD:
Construction like $ps_text =~s/^.\{22\}//g; produces a result consisting of 20 digits.
Well, I can understand how to remove the last first 22 characters and the last 1.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Petrikov, 2014-08-15
@medvedhack

Instead of a regexp in a condition.
^.\{22\}

A
Arterk, 2014-08-18
@Arterk

s/^.{22}//

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question