regex


smarty regex replace - remove unnecessary chars


I have to change string like "100,23 zł" and "29,23 $" to:
"100,23" "29,23"
So i want to remove all characters instead of numbers and ','
You can use a negated class containing only digits and comma:
[^0-9,]+
See demo on regex101.
I don't know how to do it with your language but it would be simple enough, just match anything that isn't a number or a comma and replace it with an empty string.
So match any non-digit character or a comma with: (\D|,)* or this [^0-9,]*
Replace with empty string: "" or '' depending on your language string delimiters .
you can replace this /\s\D+/ with empty string and this will do. This is applicable when you do not have any other content in the file. If you do have other contents too then try this /\d+\s\D+/

Related Links

Regex find and replace over multi lines in Shell
Grepping a 20g file in bash
What Perl matching regexp nuances can cause headaches?
What is the invalid URI error from SpamAssassin actually matching?
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

Categories

HOME
amazon-s3
elastic-beanstalk
document
vb.net
clojure
google-search
xaml
serial-port
apt-get
appium-ios
styling
genetic-algorithm
turing
stripe-payments
geany
base
struts2-jquery
clion
windows-10-desktop
rebus
image-gallery
round-robin
ssrs-2008
slowcheetah
stm32f4discovery
hp-alm
pwm
jet
django-autocomplete-light
centroid
aikau
missingmethodexception
symbolic-math
masstransit
true-type-fonts
rhel7
pdfstamper
p4-lang
mask
packaging
hawkular
automata-theory
textangular
freerdp
codeigniter-hmvc
wp-api
karnaugh-map
ase
docker-swarm-mode
ewsjavaapi
psycopg2
html-form
koala-framework
javascript-security
glumpy
mysql-error-1050
db2400
manifoldcf
rras
xlform
tag-helpers
thinktecture-ident-server
spl
nominatim
pyenchant
cocoon-gem
android-listfragment
nbug
dhc
gem
sslv3
genexus-gam
sql-server-ce-3.5
lossless-compression
vendor
boxapiv2
xml.modify
validform
declspec
windows-phone-7.1
datasift-python
polarssl
webcal
mms-gateway
mainwindow
adlds
route-me
google-authorship
sizzle
cloud-hosting
wescheme
undeclared-identifier
ekeventkit
hpple
self-organizing-maps
intel-8080
semantic-zoom
jetspeed2
exact-synergy-enterprise
android-3.1
regexbuddy
unitils
dynamic-websites
clipboard-pictures
database-dump
xlink
user-testing

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