|
|
Browse by Tags
All Tags » preg_match_all
Showing page 1 of 2 (11 total posts)
-
Hi y'all!
I'm very glad this forum exists as I'm not sure where else to turn with this question. I'm parsing the file name of a whole bunch of files in PHP using preg_match_all() and I want to recover 4 bits of information. The naming convention is:
_tag_99_Nice_name.extension
I need to break this down into 4 parts_tag_ : I ...
-
I have this kind of strings:
{test1|test2|test3}
This is easy to match with something like:
~{(.*?)}~
But I would like to be able to match strings like:
{test1|test2|test3{subtest1|subtest2}}
or
{test1|test2|test3{subtest1|subtest2{subsubtest1|subsubtest2|subsubtest3}}}
I can't figure out how I could match that in the ...
-
Hi,
New question from me. It should have been easy but cannot figure it out. I have a random text with special definitions in it. I need to get information according to the following rules:
- the important text is started with a [ followed by a keyword and a semicolon and zero or more whitespaces. The keyword is predefined.
- the first word ...
-
Hi,
We have a control system, which sends automated messages in the following syntax:
##TO admin, user1, user2
message1
##TO user2, user4
message2
##TO user5
message3
I think the syntax is obvious. From this message I need to create as many messages as many different users are after the ##TO fields. In this case ...
-
Hi all!
I'm starting to get my head around regular expressions for work, but there are still bits and pieces my mind just draws a blank with.. At the moment I'm trying to validate a text string to check if it has 5 specific values, and extract them, using PHP. Here are a few examples of valid labels
[cake] cupcake 50kg $100 ...
-
Hi all,
i have a question about regex. How can i use php preg_match_all to match all stuff inside custom tags, including any new lines.
the parsed text looks like this:
[article]
lorem ipsum dolor..
lorem ipsum dolor ...
lorem ipsum dolor ...
[/article]
expresion used for ignoring only one new line ...
-
Hello how's everyone doin'? I need help with the regular expression in PHP (using preg_match_all) that would extract the url and the image of these two:
<A HREF="movie1.mpg"><img name="movie1" src="images/tn_01.jpg" width="320" height="240" border="0" alt="Play ...
-
Hello how's everyone doin'? I need help with the regular expression in PHP (using preg_match_all) that could extract the url and the image of these two:
<A HREF="movie1.mpg"><img name="movie1" src="images/tn_01.jpg" width="320" height="240" border="0" alt="Play ...
-
It's OK, I think I've found the answer to my own question. The # signs bracket the actual regular expression, and the e and the s are modifiers - e is equivalent to PREG_REPLACE_EVAL and s is equivalent to PCRE_DOTALL. Maybe these are things which are so familiar to the experienced players that they almost go without saying, but ...
-
I have a problem which seems similar to the one documented here, so I hope somebody reading this can help me too. I have a page of PHP code which works some of the time, but not always, so I'm trying to discover the bugs in it. It includes the line
preg_match_all('#<!-- start content -->(.*?)<!-- end content -->#es', ...
1
|
|
|