Visit Mozilla.org

Core JavaScript 1.5 Reference:Global Objects:RegExp:toSource

From MDC

Non-standard

Contents

[edit] Summary

Returns a string representing the source code of the object.

Method of RegExp
Implemented in: JavaScript 1.3

[edit] Syntax

regexp.toSource()

[edit] Parameters

None.

[edit] Description

The toSource method returns the following values:

  • For the built-in RegExp object, toSource returns the following string indicating that the source code is not available:
function RegExp() {[native code]}
  • For instances of RegExp, toSource returns a string representing the source code.

This method is usually called internally by JavaScript and not explicitly in code.

[edit] See Also

Object.prototype.toSource