1: 2: 3: 4: 5: 6: 7: 8:
<html><head></head><body> <script language="javascript"> var mystring = "hello world this is a string"; var startBy = "str"; var r = new RegExp( startBy + "\\w*\\s*" ); alert( r.exec(mystring) ); </script> </body></html>