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

Browse by Tags

All Tags » preg_match
Showing page 1 of 2 (14 total posts)
  • Why does this preg_match not achive the desired results?

    Im using the following piece of php code to validate the correct format of a web address. www.mysite.com should return true www.mysite.coy should return false and trigger the...  die (comment) unfortunately both aaddresses return true.  I thought that as coy wasnt in my list of tld's that it would return true. Does ...
    Posted to Construction Advice (Forum) by wright67uk on April 27, 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
  • extracting sentences and uses from one message and compose new mails for all users with relevant sentences

    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 ...
    Posted to Construction Advice (Forum) by zorden on October 26, 2010
  • Validating a Label

    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 ...
    Posted to Construction Advice (Forum) by dmno on April 3, 2010
  • extracting strings after a keyword, optionally preceding a different keyword

    Hi folks,  I am trying to extract search terms from a string to process (in PHP). It is a free-text input box where the user can enter terms to search a database table, using AND'd, OR'd, and NOT'd expressions. Sample strings: AND this,that NOT you,me  OR red,biue NOT white   In the first example, I would like to ...
    Posted to Construction Advice (Forum) by sunnydaysahead on April 3, 2010
  • find if either stringa or stringb do not exist in a string

    I am working on making a bbcode system with php using preg_replace(), and I am making it so that other tags will not work inside of a code block. This is the code I am currently using, it almost works: /(?!\[code\])(.*)(\[b\])(.+)(\[\/b\])(.*)(?<!\[\/code\])/Usi  what I want it to do is if [*code] and [*/code] are around the text inside, ...
    Posted to Construction Advice (Forum) by sarathi on July 31, 2009
  • preg_match, to match URL in email.

    Hi,  I'm using PHP to parse an incoming email. I wish to be able to match then store URL's contained in the email message. I just need to figure out the RegEx to match URL's.  I've been currently building and testing ...
    Posted to Construction Advice (Forum) by pdxbenjamin on January 24, 2009
  • Problem with negative lookbehind in PHP PCRE Library.

    I have the following regex statement I'm trying to run in PHP.  (?<!(end\s?zone|lower|upper)\s?)(view)  Testing against the following string: (matches in bold) "The endzone view goes hi upper view and he goes view and then goes view and view and view!!!" Notice "upper view" and "endzone view" are ...
    Posted to Construction Advice (Forum) by simshaun on May 6, 2008
  • Ascending numbers with specific separators

    Hello all, I'd like to check on a php page that a text string complies with the following rule : Contain numbers,  in ascending order, with only   ,    or    -     as separators The numbers represent requested items (like pages to print), my purpose is then to count the ...
    Posted to Construction Advice (Forum) by ldauphin on February 8, 2008
  • Regex for pretty URIs

    Hi, I'm trying to write a regular expression that converts a 'pretty URI' into a standard one in the Apache .htaccess file. I'm doing it in PHP (preg_match) first, since both seem to work similarly. An example: page/c-cssstyle/t-template/p-pagenumber/ needs to be converted into ...
    Posted to Construction Advice (Forum) by cruzer on July 28, 2007
1 2 Next >