regex


Regexp: match and exclude


In this list:
image_1.png
image_1_small.png
image_2.png
image_2_small.png
image_three.png
image_three_small.png
antoher_image.png
I would like to match only those images that BEGIN with the word image BUT do not contain the word small.
The regex should then return:
image_1.png
image_2.png
image_three.png
So far I have:
/^image(?!.*small)/m
I tested this with your single lines from the list
^image(?!.*_small.*).*\.png$
see also this discussion on how to exclude keywords in regex

Related Links

Validate postal cade using Regex on each character
VBA regex - match an expression that doesn't begin with a particular word
How to pass variable to regular expression in PERL
Batch rename screen shots on Mac OS X
US Phone regex that works in IE
Regex with lookaround for Lazarus
codeigniter regular expression for uri slug in routes
regex to match strings not preceded by a bang
What would the regex to match the hostname of this string?
How do I do a regex search and replace in sublime text 2?
Why are these regular expressions different?
r regex mileage
What is the complexity (Big-O) of searching an indexed data in mongoDB?
Filtering multiline pcregrep match with sed
How to remove a word prefix using grep?
How to create a regexp that catches everything that isn't a pure number

Categories

HOME
mocking
printing
coffeescript
azure-search
direction
python-3.5
azure-web-sites
design
asana
runtime-error
libreoffice
xcode8
gluon
documentation
asciidoc
bluej
eloqua
scrollbar
reload
accumulo
jgit
next
angular-components
data-annotations
stackexchange-api
multiprocessing
nice-language
jqplot
regex-group
number-formatting
android-arrayadapter
charts.js
breakpoint-sass
lifecycle
hamcrest
bits
uistoryboardsegue
spring-saml
jsonstore
csr
plasticscm
procobol
pac
firedac
automata-theory
angular2-seed
httpexception
win2d
android-calendar
adal.js
ssms-2012
wrk
kony
manual
javascript-security
netbeans-7
graph-traversal
swift-package-manager
dr-memory
wxhaskell
hard-drive-failure
tfs2008
proc
measurement-protocol
mit-scheme
xendesktop
ng-annotate
kernighan-and-ritchie
strace
administrator
autopy
sample-data
many-to-one
push-api
bloodhound
centering
conditional-statements
json-web-token
slick2d
bitrock
typesafe-activator
sendto
bessel-functions
mouseenter
android-c2dm
data-dictionary
showcaseview
jquery-mobile-popup
buildout
eject
media-manager
ekeventkit
jscience
magento-1.5
data-oriented-design
mkreversegeocoder
unitils
plumtree

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App