I am using jQuery 1.3.2 and I have an input field on my page that provides link to be copied, like this one: http://mydomain.com/resize.php?src=http://www.externaldomain.com/content/Uploads/everydaymail.jpg&w=533&h=400&zc=1 . I would like to use jQuery and be able to change w=533 part to w=300, for example and also the h=400 to change into h=200 . This is an image resizing script that I’m using and I want to be able to change the height and width parameters from that link in the inputbox with my desired values that are dynamic.
I am no good at regex, can anyone provide an example/suggestion ?
Thanks.
I ended up using:
I think the regex could be a little smarter but it also works great this way.
Thank you for your suggestions.