Text search with RegEx's

Results 1 to 2 of 2

Thread: Text search with RegEx's

  1. #1
    Join Date
    Dec 1969

    Default Text search with RegEx's

    Hi all,<BR><BR>I have a text search that searches through a text file looking for the string the user entered. At present if i search for say "john" it returns all the lines with "John" in but also lines which contain "Johnson" or "Johns".<BR><BR>What i&#039;m after is an exact searh so only what the user searchs for is diplayed. How would i go about using RegEx to accomplish this? any help that would put me on the right track would be great.<BR><BR>Thanks in advance.

  2. #2
    Join Date
    Dec 1969

    Default RE: Text search with RegEx's

    you can wrap your expression in boundary matching metacharacters like so:<BR><BR> (john)<BR><BR>That will ensure that the text "john" is boundaried by non-"word" characters such as spaces, %^$#&(*, etc and linefeeds.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts