473,503 Members | 3,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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 963

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

Similar topics

12
1892
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
2056
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
408
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
239
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
3199
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
1679
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
5128
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
262
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
11311
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
23234
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
7064
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
7261
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,...
1
6974
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
5559
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,...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.