Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 08-16-2008, 08:37 AM Regex
pealo86's Avatar
Super Spam Talker

Posts: 849
Name: Matt Pealing
Location: England, north west
Trades: 0
I assumed that Regular Expressions were the same throughout all languages? However I tried testing something in JavaScript in the same way that i have done in PHP with:

Code:
var regex = new RegExp ('[[:alpha:]]');
var string = 'asda sda a';

alert (regex.test (string));
This results in 'false', however

Code:
var regex = new RegExp ('[a-z]');
var string = 'asda sda a';

alert (regex.test (string));
results in true! Is is just that not all languages have names for character classes like PHP does?

Please don't tell me that Regex can be massively different across all languages!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 08-16-2008, 11:37 AM Re: Regex
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Please don't tell me that Regex can be massively different across all languages!
Ok we won't tell you then
But these will -> http://www.regular-expressions.info/

well maybe not "massively different" but there are syntactic and implementational differences.


http://www.w3schools.com/js/js_obj_regexp.asp
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-17-2008, 09:55 AM Re: Regex
pealo86's Avatar
Super Spam Talker

Posts: 849
Name: Matt Pealing
Location: England, north west
Trades: 0
Ahhh thanks, from what Ive looked at so far it just seems as though RegEx is just a standard that would apply to all languages? Or maybe I just haven't seen enough of the site yet!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 08-18-2008, 04:12 AM Re: Regex
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
That about sums it up.

How it is actually implemented is often "flexible"
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Regex
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19789 seconds with 12 queries