Jump to content

The Letter E

Members
  • Posts

    266
  • Joined

  • Last visited

Everything posted by The Letter E

  1. Just a note, as this may be your problem. In regexp "$" matches EOL (end of line), that means if you have multiple words you want to match in a single line it will not work. You may instead be looking for "\b" which is a word boundary character. A word boundary is usually triggered by a space or punctuation. I do agree with @Psycho on not using RegExp if it's not necessary. It's simply one of the many tools at our disposal and should be weighed against all other options before being selected as the right tool. However were I to use regex I would process against an entire paragraph, or block of text like this: preg_replace('/(\w+ss)\b/', '$1\'', $mytext); I hope this was helpful to the op or anyone else who comes across this thread. E
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.