Hello everyone.
I am trying to build a regex that will take information from between two delimiters.
The delimiters are "{" and "}". I'm trying to get everything in between those two characters.
I've looked at all the tutorials, but I don't really have a clue.
If anyone could give me a few pointers, that would be great
Thanks,
Sphenn
Regex Question
Moderator: General Moderators
-
RobertPaul
- Forum Contributor
- Posts: 122
- Joined: Sun Sep 18, 2005 8:54 pm
- Location: OCNY
Well ...
That would do it.
Code: Select all
/\{.*\}/I would use ... the negated } will be faster than having to backtrack...
(untested)
Code: Select all
/{([^}]+)}/(untested)
to create a reference...
edit:
damn it! I guess the bbcode or something is killing my escape slashes...there needs to be backslashes right before the { and }
Code: Select all
$pattern = /\{(.*?)\}/;edit:
damn it! I guess the bbcode or something is killing my escape slashes...there needs to be backslashes right before the { and }