how do i convert a c# regular expression to php...

3 replies
I'm rusty as hell in php and need to fix a small bug in one of my plugins. I know the regex I could use would be written in c# as such:

(?<!<[^>]*)keyword

[>].*(keyword).*[<]

I don't for the life me remember how different regex is in php.

- Reilly
#convert #expression #php #regular
  • Profile picture of the author Jonas B
    Signature
    Proud owner of the most flexible mobile app builder. Check it out at http://bit.ly/hybrica!
    Mobile Web Expert & Android Developer
    {{ DiscussionBoard.errors[3559300].message }}
  • Profile picture of the author SteveJohnson
    I don't know c# regex, but be aware that the ereg functions in PHP have been deprecated, you'll need to use the PCRE 'preg' functions.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3559376].message }}
  • Profile picture of the author dtang4
    If this helps shed some light... PHP preg is just using Perl's regular expression syntax.
    Signature
    {{ DiscussionBoard.errors[3561285].message }}

Trending Topics