How do I change my regex to include also max. number of words?
De persoon die dit onderwerp heeft geplaatst: Fredrik Pettersson
Fredrik Pettersson
Fredrik Pettersson  Identity Verified
Hongkong
Local time: 03:24
Lid 2009
Engels naar Zweeds
+ ...
Feb 16

I have this regex now:

(\w+\s+){4}\w

I want that it also states max. 5 number of words to filter on. How do I add that condition in my regex?


 
Stepan Konev
Stepan Konev  Identity Verified
Rusland
Local time: 04:24
Engels naar Russisch
^(?:[\w]+\s){0,4}[\w]*[\s\.?!;\,]*$ Feb 16

If you want to capture segments consisting of up to 5 words, either with or without punctuation marks or space at the end, you need this regex: ^(?:[\w]+\s){0,4}[\w]*[\s\.?!;\,]*$

 
Fredrik Pettersson
Fredrik Pettersson  Identity Verified
Hongkong
Local time: 03:24
Lid 2009
Engels naar Zweeds
+ ...
ONDERWERPSTARTER
Regex for max/min number of words Feb 19

Works excellent to use your new regex for this project. Thanks a lot Stepan!

 


To report site rules violations or get help, contact a site moderator:

Moderator(en) van dit forum
Laureana Pavon[Call to this topic]

You can also contact site staff by submitting a support request »

How do I change my regex to include also max. number of words?






TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »