2041
Dave_L
Re: Need help from Regular Expression Guru
  • 2004/1/13 23:59

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Oh, I forgot. You need the "s" modifier if you want "." to match newlines:

preg_match('/^foobar3.+foobar6$/s', ...)

Are you sure you want the "^" and "$" anchors? This pattern wouldn't match the text you posted above, since it starts with foobar1, not foobar3; and ends with foobar10, not foobar6.



2042
Dave_L
Re: Need help from Regular Expression Guru
  • 2004/1/13 15:58

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Using multiple * or + metacharacters gets tricky.

You can also match linebreak characters more specifically:

/foobar1\nfoobar2/

You might need to do this, to allow for different platforms:

/foobar1(\r\n|\n|\r)foobar2/

Could explain what overall problem you're trying to solve? There might be a better approach.





2043
Dave_L
Re: Need help from Regular Expression Guru
  • 2004/1/13 14:11

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


skalpa's regex pattern is correct, but actually * means "zero or more". + means "one or more". And note that \s matches any whitespace character: space, tab, \n, \r, etc.



2044
Dave_L
Re: Need help from Regular Expression Guru
  • 2004/1/13 4:59

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


<?php

$text 
"
foobar1
foobar2
foobar3
foobar4
"
;

if (
preg_match('/foobar2s*foobar3/'$text)) {
   echo 
"Matchedn";
} else {
   echo 
"Not matchedn";
}

?>



2045
Dave_L
Re: Can we use freely xoopy mascotte ?
  • 2004/1/12 19:12

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Quote:
If it is not released under ANY license whatsoever, then it is PUBLIC DOMAIN. That means that anyone can take it, modify it and use it without asking for permission of any kind and/or contacting the author, or in this case creator.


That is definitely not true. An item is implicitly copyrighted by its creator, whether or not he states so.



2046
Dave_L
Re: empty notifications list
  • 2004/1/12 15:04

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Events show up in the notifications list after you subscribe to them.

You can subscribe to a forum topic (for example) by checking one of the boxes at the bottom of the page when you're reading or replying to the topic ("Notify me of new posts in this thread").



2047
Dave_L
Re: Help with a default theme hack
  • 2004/1/11 16:11

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Re: Smarty Debugging

Thanks. I was blocking popups, but turned that off, and it works now.



2048
Dave_L
Re: can't make block visible
  • 2004/1/11 6:19

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Enable the Block Access Right for the Anonymous Users group:

Control Panel >> System Admin >> Groups >> Anonymous Users >> Modify >> Block Access Rights



2049
Dave_L
Re: Help with a default theme hack
  • 2004/1/11 4:48

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Quote:
you can turn on Smarty Debugging to check out the Smarty variables available per page


What does that do exactly? I turned it on, but don't see any extra information displayed.



2050
Dave_L
Re: Admin Menu Issues
  • 2004/1/11 3:51

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Nothing should be in the middle, until you click on one of the buttons on the left.




TopTop
« 1 ... 202 203 204 (205) 206 207 208 ... 212 »



Login

Who's Online

139 user(s) are online (81 user(s) are browsing Support Forums)


Members: 0


Guests: 139


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits