regex - How to remove the word and digit with underscore in a string -


i use regular expressions remove "2_abc_" in following string:

$a="2_abc_300_300_300_300_1_120";

i have tried:

$a=~ s/^\d_\w*//;

but doesn't work since w includes numeric, undercore , alphabet.

you can use [a-za-z] insted of \w. or [a-z] if want lower case letters.

also, if want @ least 1 letter use + instead of *.

if want 3 letters use [a-z]{3}.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -