Results 1 to 4 of 4

Thread: Convert php expression

  1. #1
    Join Date
    Nov 2009
    Posts
    583

    Convert php expression

    Hi
    I am working on a program and I need to convert the following expression in preg_match
    Code:
    ereg("<(/?[[:alpha:]]*)[[:space:]]*([^>]*)>",$str,$reg)
    I tried the following code, please check if it is correct
    Code:
    preg_match("/<(/?[[:alpha:]]*)[[:space:]]*([^>]*)>/",$str,$reg)
    It is giving me an error. Any one any solve the error for me. Please help.

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: Convert php expression

    Hello
    I did not understand what are you trying to match. Please post in more details, so that I can help you.
    Code:
    preg_match("/<(/?[[:alpha:]]*)[[:space:]]*([^>]*)>/",$str,$reg)
    I am not that good in regexp, but I will definetilly try for you, but for that please send me some more details.

  3. #3
    Join Date
    Nov 2009
    Posts
    583

    Re: Convert php expression

    Hi
    Thanks guys, i think I have solved the problem. It is working fine till now. I have posted it below. Please check if any thing else is missing from here.
    Code:
    preg_match("/<(\/\?[[:alpha:]]*)[[:space:]]*([^>]*)>/",$str,$reg)
    Any suggestion or advice on this.

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Convert php expression

    Hi
    I am glad that you have solved it by your own. Nothing seems to be wrong with the following expression, seems it is correct.
    Code:
    preg_match("/<(\/\?[[:alpha:]]*)[[:space:]]*([^>]*)>/",$str,$reg)
    sorry, even I am not so sure about this, because even i am not fully perfect in PHP regexpression. But you expression looks pretty perfect.

Similar Threads

  1. Regular expression Help in asp.net for DOB.
    By maheshmartha in forum Software Development
    Replies: 2
    Last Post: 06-03-2010, 07:06 AM
  2. How to use Switch Case Expression in PHP?
    By super soaker in forum Software Development
    Replies: 5
    Last Post: 06-03-2010, 03:07 AM
  3. why to use * at the start of a C expression?
    By Nadiaa in forum Software Development
    Replies: 4
    Last Post: 10-02-2010, 10:57 PM
  4. When will Expression Blend 3 be available
    By Madison in forum Windows Software
    Replies: 3
    Last Post: 15-07-2009, 09:26 PM
  5. Access - Expression for Request
    By Wiro in forum Software Development
    Replies: 4
    Last Post: 01-04-2009, 11:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,755,447.99142 seconds with 16 queries