Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Browse by Tags

All Tags » php
Showing page 1 of 13 (128 total posts)
  • BBCode --> HTML table

    Hello I have a forum that allows custom bulletin board code to be executed through PHP files. Now I'm trying to construct a html table tag from some kind of 'template'. A pipe symbol designates the delimiter between individual cells of the table and a linebreak designates that a new table row should be inserted. Ofcourse, there is no ...
    Posted to Construction Advice (Forum) by Vince0789 on May 13, 2011
  • Masking email tags

    Hi, im trying to mask all html "a" tags in php using preg_replace_callback what contains a valid email address in href attribute, "mailto:" would be optional. a-tags can have any possible syntax, so im trying to match all [ \t\r\n\v] and chars between <a........href and after @dd.ee".........>, i assume i have ...
    Posted to Construction Advice (Forum) by BringerOfTheDawn on May 8, 2011
  • Capturing tags and attributes to reconstruct html

    Hi there, I like to have a named capture regular expression who captures the following from a html string: some_tag, could by p div span, (?P<container_start>..... the total class attribute cont_p_img_left, right or center and not other classes, (?P<container_class>..... the last part of the class attribute, ...
    Posted to Construction Advice (Forum) by pietjepel on April 30, 2011
  • How catch all occurences?

      Hi!  I am working in PHP and came up with this: $this->addKeyword(      preg_replace('/(.*?)[Cc]-? ?[Ss]harp(.*)/i', '$1C#$2', $wgTitle) );  It is intended to catch "csharp", "c sharp", and "c-sharp" regardless of case and replace it with ...
    Posted to Construction Advice (Forum) by hyle on April 7, 2011
  • parsing set of encoded file names

    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 ...
    Posted to Construction Advice (Forum) by CpILL on March 17, 2011
  • 2 days of mental block!

    Okay I have spent two days on a mental block in PHP using the stristr() command. Here's the deal.    A simple text file loaded in as a string where the following needs to be found in the string: beginning of line, three periods a space, some word or two words, a space and three periods EXAMPLES:      ... WORD ONE ...
    Posted to Construction Advice (Forum) by johnbasham on March 7, 2011
  • How to match same pattern existing inside pattern?

    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 ...
    Posted to Construction Advice (Forum) by www on February 13, 2011
  • Constructing Regex To Extract Multiple Data

    I need a regular expression to get the Event, Name, School, Final Swim Time, and Swim Threshold (The DIIA) from a Results page like the one at ( http://www.gliac.org/sports/mswimdive/2010-11/stats/Results_Wed_Finals.htm ). Note that the results are sepereated from the rest of the page by the "<pre>" html tag. Each "line" ...
    Posted to Construction Advice (Forum) by mrgoodboy77 on February 13, 2011
  • (PHP) Regex to capture list of field=value

    Using PHP. Here is a few examples of strings that I am working with: part=1 total=1 line=128 size=2799 name=name.of.file.12-group.nfo  part=2 total=3 line=128 size=2124 name=different name of file.rarBasically I need to match the field name (part, total, size, name, but there can be any combination of these and possibly others as well) ...
    Posted to Construction Advice (Forum) by tesco on November 5, 2010
  • Find all URLs to shorten for Twitter

    I am using the Shorten URL in a text using Bit.ly PHP class by Muhammad Arfeen and I would like to replace his code with Philippe Leybaert's code. The original PHP code is below: preg_match_all(’(((f|ht){1}(tp://|tps://))[-a-zA-Z0-9@:%_+.~#?&//=]+)’, $text, $hyperlinksArray); Here is the same code with Philippe ...
    Posted to Construction Advice (Forum) by thripp on September 4, 2010
1 2 3 4 5 Next > ... Last ยป