0

Please, help me to build a regex.

I have a lot of data with such items: '01. Item1', '02.Item3', '3D Item', 'Item next', ...

I need to build a regex, to normalize this to the following: 'Item1', 'Item3', '3D Item', 'Item next', ...;

I have tried next regex, but it cuts '3D item' to 'D item': $item =~ s/^( [\d.\s]* (?=[a-zA-Z]) )? //x ;

4

1 回答 1

4

Try following regex:

$item =~ s/^\d+\.\s*//;

regex101 demo

于 2013-10-30T16:24:23.087 回答