Solved

Regular Expression to do an exact word match

Posted on 2014-09-30
2
100 Views
Last Modified: 2015-01-05
Just need a reqular expression to do an exact word match.  For example;

String 1 =  This a test containing a Street.
String 2 =  Street is in the string at the beg.
String 3 =  St. is some chars Street in this big string.
String 4 =  This string contains Streets not str.


I need the expression to find "Street" in strings 1 -3 above.  String 4 should not be picked up.
0
Comment
Question by:hojohappy
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 40352418
\bStreet\b
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40448689
Did ozo's suggestion not work for you?
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
numeric only entry in text inpu 9 44
Regex code,how to do this? 3 44
t-sql split string into multiple rows 7 120
CC Dreamweaver Regular Expression Problem 14 19
by Batuhan Cetin Regular expression is a language that we use to edit a string or retrieve sub-strings that meets specific rules from a text. A regular expression can be applied to a set of string variables. There are many RegEx engines for u…
Whatever be the reason, if you are working on web development side,  you will need day-today validation codes like email validation, date validation , IP address validation, phone validation on any of the edit page or say at the time of registration…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question