473,396 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[Regular Expression] excluding alphanumerical chars

teo
Hallo,

I need to match a word in its "absolute" way, that is

with no alphanumerical chars
before and after it :
only blank spaces and interpuntuaction are accepted.

I tried with
[\W]myword[\W]

it works, but
it misses the cases where myword is at
the beginning of the line
and
at the ending of the line

Here is a screenshot (13kb) of the situation:
http://www.zshare.net/image/immagine-gif-7rk.html
Here is the same texting text :

Per andare per galli con la speranaza però di alcuno per
Non vorrei -per ma anche per- quindi abbiamo .Per, cuiper e salame per.
Per Non vorrei per
Sep 20 '06 #1
0 960

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: hq4ever (at) 012 (dot) net (dot) il | last post by:
function testemail($email) { $validEmailExpr = "^(?)*@(?)*$"; return eregi($validEmailExpr, $email); } $email = "foo@bar.gov.mil"; testmail($email); //return TRUE
5
by: sbd! | last post by:
I had a problem with string which have some \ chars at the end of the string. For example: $String = "I want this **** out of here\\\\\\\\\"; I needed to remove it useing regular...
1
by: Stefan Reiter | last post by:
Hi, I need one function to validate streetnames and one to validate names. I tried to write my own regular expression and to use preg_match, but for some weird reason I can't get it to work. ...
2
by: Ron Vecchi | last post by:
I'm tring to figure out the expression to use to search a bunch of documents that contain a word but do not contain a different word. Not having any luck though! Any ideas Thanks for the...
3
by: James D. Marshall | last post by:
The issue at hand, I believe is my comprehension of using regular expression, specially to assist in replacing the expression with other text. using regular expression (\s*) my understanding is...
2
by: Ross Ylitalo | last post by:
I have been trying to put together a regular expression that will trap any string with the exact string "&#" (without the quotes) and have been having no luck. Can anyone tell me if this is...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
0
by: teo | last post by:
Hallo, I need to match a word in its "absolute" way, that is with no alphanumerical chars before and after it : only blank spaces and interpuntuaction are accepted. I tried with myword
7
by: Sharkie | last post by:
I need a regular expression which will evaluate to false if number of consecutive characters (non-whitespace) exceeds certain number (10 in this example). For example, I have this function: ...
8
by: Sharkie | last post by:
I need a regular expression to evaluate a text input field. The validation rules are: 1) only A-Z and 0-9 chars allowed, 2) only one alpha char allowed (at any position) - rest are digits, 3)...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.