News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Profile Field Input Mask (Regex)

Started by Jade Elizabeth, August 29, 2012, 01:00:43 PM

Previous topic - Next topic

The Craw

Quote
The website doesn't test php regexp, but ruby (could be different)

Are you completely serious right now? Is there some good reason for this that my limited understanding of Ruby can't quite grasp?!

emanuele

Well, I know nothing about Ruby, but I know different languages can have differences. So I cannot be completely sure a regexp written for ruby will work on php.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

The Craw

I'm wondering why SMF is using Ruby regex in the first place.

Suki

Where?

Regex in Ruby, Python and PHP is pretty much the same, there are no differences, Regex problems are because of string escaping  but the rules on regex itself are the same.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

emanuele

Quote from: The Craw on September 07, 2012, 07:42:43 PM
I'm wondering why SMF is using Ruby regex in the first place.
Rubular (the website I linked for regexp testing purpose) is using Ruby, not SMF! ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

MrPhil

SMF, being written in PHP, uses Perl style regular expressions (preg_* library). As nice as it would be to have all regular expression parsers across all languages (and editors, utilities, and compiler generators) use exactly the same syntax, it appears that every code author has ended up with personal interpretations of the standard which are a little bit different. This isn't even counting ancillary stuff like the need (or not) for expression delimiters around the pattern. Same thing with browsers and the interpretation of HTML, CSS, and Javascript/JScript standards.

The Craw

Quote from: emanuele on September 08, 2012, 04:22:29 AM
Quote from: The Craw on September 07, 2012, 07:42:43 PM
I'm wondering why SMF is using Ruby regex in the first place.
Rubular (the website I linked for regexp testing purpose) is using Ruby, not SMF! ;)

OHHHHHH! I thought that was about the strangest thing I've heard all week. :P

This is what happens when I stay up too late and don't read thing correctly...

Advertisement: