$title = ':(.*)./msU'; preg_match_all($title, $value, $matche); PHP: this gives me: Warning: preg_match_all() [function.preg-match-all]: No ending delimiter ':' found in C:\wamp\www\zzz\test.php on line 34 : My Input: <li><a name="ChenFL02" href="../../indices/a-tree/c/Chen:Ping.html">Ping Chen</a>, <a href="../../indices/a-tree/f/Fu:Zhaohui.html">Zhaohui Fu</a>, <a href="../../indices/a-tree/l/Lim:Andrew.html">Andrew Lim</a>: The Yard Allocation Problem. 3-8 <font size="-3"><a href="http://dblp.uni-trier.de/rec/bibtex/conf/aaai/ChenFL02">BibTeX</a></font> Code (markup):
When using preg_match/_all you need to have the exact start/end character: Examples: /$PATTNER/ |$PATTERN| etc.. Since you used ":" as the beginning character, it was expecting an ending character to be the same, thus the error "delimiter ':' not found'. If you only need to extract the name, then you will use this: preg_match_all('/:([.+])\.html/Us',$content,$results); PHP: $results[0] will contain the actual text it was found in, and $results[1] will contain the array of matches. Peace,
I am trying to match between : and . you see: </a>: The Yard Allocation Problem. I wanted to fetch: "The Yard Allocation Problem"
Please see: <a name="Walsh07" href="../../indices/a-tree/w/Walsh:Toby.html">Toby Walsh</a>: Uncertainty in Preference Elicitation and Aggregation. 3-8 <font size="-3"> I want to fetch 3-8 using "preg_match_all" any help, this is not constant, this a variable so can be changed but will be a number with "-" sign.
thank you, so d will be used or int values, what we can use for strings?, so that "Uncertainty in Preference Elicitation and Aggregation" can be fetched. thank you
Here's a nice video tutorial. http://www.phpvideotutorials.com/regex/ And these might be useful as well. http://www.regular-expressions.info/ http://www.php.net/reference.pcre.pattern.syntax http://weblogtoolscollection.com/regex/regex.php http://regexlib.com/