W
W
WhiteSama2015-11-26 12:51:09
Regular Expressions
WhiteSama, 2015-11-26 12:51:09

What regexp to use?

I don’t rummage in regexps, but the situation is this: when adding an element to an attachment, Joomla assigns a stamp to the file name. this stamp should be removed. example: the original filename is ppl.jpg. when adding, an underscore and ten digits are assigned - ppl_1448462046.jpg
What regexp can be used to cut _1448462046? (numbers may vary)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
heartdevil, 2015-11-26
@WhiteSama

Hello, try this one .
#(_\d{10,})#gim

A
Andrey Danilov, 2015-11-26
@Danand

With .jpg extension:
Without .jpg extension:
_\d+$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question