Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
HTML Pages with CSS and JavaScript
string search in JS
auvrm papu
Ranch Hand
Posts: 105
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm looking for a JS function to get me the value between two braces.
for ex:
var myStr = "mytest[34]"
I want to retrive 34.
How do i do that?
thanks
Eric Pascarello
author
Posts: 15385
6
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Basic regular expression:
var myStr = "mytest[34]"; var re = /.+\[(\d+)\]/; var foo = myStr.replace(re, "$1"); alert(foo);
Eric
auvrm papu
Ranch Hand
Posts: 105
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Eric.
That was a very prompt reply!
Eric Pascarello
author
Posts: 15385
6
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You just got lucky I checked the ranch a little after you posted!
Eric
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Average age of Ranchers
missing name after . operator ?
JSTL for loop
Force Save
when 400 mark will reach?
More...