bash sed command failing to find and replace -


i can not following bash sed commands find , replace fails match:

$ sed -i.bak 's,\"js/lj.main.min.js\?\d{14}\","js/lj.main.min.js?20130521080532",g' index.html 

or

$ sed -i.bak 's,\"js/lj\.main\.min\.js\?\d{14}\","js/lj.main.min.js?20130521080532",g' index.html 

on text file including:

<script src="js/lj.main.min.js?20130520120515"></script> 

should change to:

<script src="js/lj.main.min.js?20130521080532"></script> 

the regex works when try in http://fiddle.re/m7x56

so whats up?

this expression works me:

's,"js/lj\.main\.min.\js?[0-9]\{14\}","js/lj.main.min.js?20130521080532",g' 

note there many versions of regular expression libraries. features (\d) might not supported, backslashing of special characters can different ({}, ? etc.)


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -