Skip to content
Advertisement

Extract numbers after each occurrence of a substring [closed]

My input:

JavaScript

How can I get output with php?

Extract number after .id.

Desired result:

JavaScript

Advertisement

Answer

Match a literal dot, then id, then a literal dot, then reset the fullstring match with K, then match one or more digits.

Implode the matches with commas.

Code: (Demo)

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement