KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
var str = 'asd-0.testing'; var regex = /asd-(\d)\.\w+/; str.replace(regex, 1); That replaces the entire string str with 1 . I want it to replace the matched substring instead of the whole string. Is this possible in Javascript?
Tags (comma-separated)
Save Edits
Cancel