473,503 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What's the future of RegExp object properties?

Hallo,

I yesterday was browsing the book, JavaScript The Definitive Guide
(4th ed), which is, unquestionably, the best reference book for JS. To
my surprise, I didn't find any documentation about the static
properties of global RegExp object, ie, RegExp.lastMatch,
RegExp.leftContext, RegExp.rightContext, and all those RegExp.$x
properties. I lloked up the ECMA-262 PDF and to my surprise realized
that they are not included into the standard.
I don't wuite know the reasons, why it is done so, I may guess that
it's because of their awkward namespace. Still, that functionality is
specified in core JavaScript 1.2 (at least JavaScript the Definitive
Guide 3rd ed states so), and I doubt that such features would be taken
off from the JavaScript standard in future. It's somewhat bitter that
the 4th edition focuses on ECMA standard rather than JavaScript.
But now, I am quite concerned about the future of those RegExp object
properties. I there some info about their possible inclusion in the
ECMA standard? Is it now 'deprecated' to use them, and coders should
use workarounds?

Thanks,

-- Pavils
Jul 20 '05 #1
1 1725


Pavils Jurjans wrote:
I yesterday was browsing the book, JavaScript The Definitive Guide
(4th ed), which is, unquestionably, the best reference book for JS. To
my surprise, I didn't find any documentation about the static
properties of global RegExp object, ie, RegExp.lastMatch,
RegExp.leftContext, RegExp.rightContext, and all those RegExp.$x
properties. I lloked up the ECMA-262 PDF and to my surprise realized
that they are not included into the standard.
I don't wuite know the reasons, why it is done so, I may guess that
it's because of their awkward namespace. Still, that functionality is
specified in core JavaScript 1.2 (at least JavaScript the Definitive
Guide 3rd ed states so), and I doubt that such features would be taken
off from the JavaScript standard in future. It's somewhat bitter that
the 4th edition focuses on ECMA standard rather than JavaScript.
The standard for JavaScript is the ECMAScript standard which is
currently in edition 3. This is the first edition to introduce RegExp at
all, and as you have found out the static properties you list above are
not defined in that standard. Thus there is no need to "take the
features off from the Javascript standard in the future", they are not
part of the standard.
But now, I am quite concerned about the future of those RegExp object
properties. I there some info about their possible inclusion in the
ECMA standard? Is it now 'deprecated' to use them, and coders should
use workarounds?


As RegExp implementations with those properties existed when ECMAScript
edition 3 was written I am sure these properties were intentionally not
made part of the standard and therefore I guess there is no intention to
add them in later editions.
As for the reasons I guess it is akward that instance methods have the
side effect of changing static properties. Of course it would have been
nice to have things like rightContext as a property of the result of
exec but somehow it is not part of the standard.
As for using those properties if you want to write cross browser
JavaScript don't do it, for instance Opera 7 (tested with 7.20) doesn';t
implement rightContext at all.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6783
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
2
4043
by: timmy_dale12 | last post by:
Im implementing a calendar and cant figure out what this method does or how it works // datetime parsing and formatting routimes. modify them if you wish other datetime format function str2dt...
10
7652
by: Andrew DeFaria | last post by:
I was reading my O'Reilly JavaScript The Definitive Guide when I came across RegExp and thought I could tighten up my JavaScript code that checks for a valid email address. Why does the following...
20
3507
by: RobG | last post by:
I'm messing with getPropertyValue (Mozilla et al) and currentStyle (IE) and have a general function (slightly modified from one originally posted by Steve van Dongen) for getting style properties:...
0
1799
by: Chris Croughton | last post by:
I'm trying to use the EXSLT regexp package from http://www.exslt.org/regexp/functions/match/index.html (specifically the match function) with the libxml xltproc (which supports EXSLT), but...
8
11412
by: kevin | last post by:
I have a form and in the form I have a sub that uses a class I instantiate using visual basic code: Public oCP As New Rs232 'instantiate the comm port I need to share this sub with...
2
4737
by: brad | last post by:
Hello all, I'm new to javascript--not too new to a few other programming languages--and I need your help deciphering the Regexp in the following string. Regular expresions are hard enough in...
12
2039
by: EME | last post by:
typeof new RegExp ---------------------------------------------------- Why (new RegExp) type is function not object very thanks for you consulation
4
3890
by: Matt | last post by:
Hello all, I have just discovered (the long way) that using a RegExp object with the 'global' flag set produces inconsistent results when its test() method is executed. I realize that 'global'...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.