vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   The stuff after trailing slashes in regexps (https://vborg.vbsupport.ru/showthread.php?t=53348)

filburt1 05-24-2003 09:00 PM

The stuff after trailing slashes in regexps
 
It took quite a bit of research, but here's what those characters after regular expressions mean:
  • i: case-insensitive
  • c: effectively means return what doesn't match the expression
  • m: don't ignore whitespace differences
  • s: ignore multiple lines when using the match chars (*, ?, +, etc.)
  • x: allow whitespace and comments (for readability)
  • U: don't be greedy
I still can't figure out what U does (vB uses //siU everywhere), but those five are the common ones.

Boofo 05-25-2003 12:44 AM

What does the i do in siU?

filburt1 05-25-2003 12:45 AM

Case-insensitive (stupid JS-based vB code generator...)

Logician 05-25-2003 09:17 AM

Quote:

Today at 05:16 AM filburt1 said this in Post #1
I still can't figure out what U does (vB uses //siU everywhere), but those five are the common ones.
U specifies "greediness". Roughly that is whether search returns the largest matched pair or the smallest, if there are more than 1 matches.

filburt1 05-25-2003 11:10 AM

But isn't .? used for that (rather than .*)?

Logician 05-25-2003 02:07 PM

Say you have this text:
Quote:

aaaaa
[bbb]
ccccccccccccc
[bbb]
dddddddddddd
[/bbb]
eeeeeeeee
[/bbb]
ffffffffffff
and you are trying to match chars between [bbb] tags. Would your regular expression return:
Quote:

dddddddddddd
or:
Quote:

ccccccccccccc
[bbb]
dddddddddddd
[/bbb]
eeeeeeeee
that is what greediness parameter specifies.

filburt1 05-25-2003 02:08 PM

I know what it means, I mean that isn't that what the ? operator is used for rather than the * operator?


All times are GMT. The time now is 12:09 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01606 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete