Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Internet & the Web (https://www.askmehelpdesk.com/forumdisplay.php?f=177)
-   -   Help me with PHP eregi_replace()! (https://www.askmehelpdesk.com/showthread.php?t=27082)

  • Jun 1, 2006, 09:19 PM
    xuanmanh
    Help me with PHP eregi_replace()!!
    I want to search within a string for substrings which contain "src=" and does not contain "some" next to it.
    For example this substring "src=thingsome" should match and this "src=something" shouldn't.

    Can you tell me how to do this?
  • Jun 2, 2006, 01:30 AM
    LTheobald
    I don't have PHP on this PC so I can't test this at the mo but try:
    Code:

    src=(?(?!some)(.*))
    I've got a feeling this will work with preg_replace but not ereg_replace or eregi_replace.

    Also some useful links for you:
    http://www.regular-expressions.info/quickstart.html
    http://www.weitz.de/regex-coach/
  • Jun 2, 2006, 09:07 PM
    xuanmanh
    Thank you for your recommendation, I'll check the links to find more

  • All times are GMT -7. The time now is 03:49 AM.