Microsoft
Software
Hardware
Network
Question : Regex for number and string
Hi all,
I need help for a regex that can handle the following scenarios:
xxx,xxx djfksajfkdasf offers
xxx djfksajfkdasf offers dfsajfka
xx djfksajfkdasf offers
x djfksajfkdasf offer
"x" stands for number 0-9. Indeed xxx.xxx.xxx.... is the number with thousands separators. "djfksajfkdasf" and "dfsajfka" are any combinations of numbers, chars, and spaces. The "offers" or "offer" is a specific word that I want to match.
Essentially, the string has a number, followed by something that I am not interested in, and then by a specific word that I am interested in, and by something else and nothing that I am not interested in.
It will be nice that the number part can include some currency signs like $, ¿, etc.
Please help!
Thanks.
Answer : Regex for number and string
Here is a slightly modified version, tested on both eclipse ide and an online regex testing tool (
http://www.fileformat.inf
o/tool/reg
ex.htm
):
"[$£]?[0-9,*]+ (.)+ offer(s)?(.)*"
Random Solutions
PHP - sql script
USB port on compaq laptop w/XP will not work with USB mouse
Adding Exchange to an existing POP in Outlook
Unable able to rename database in sql server
Error when running "Set-ReceiveConnector" on my exchange 2007 server.
Formatting a Hard Drive with sensitive data
When I un-install GroupWise 6.5, Microsft Excel will not open (compliation errors).
Roaming Profiles - Replacing Windows XP Pro workstations with Windows 7 workstations.
adding an AHCI storage controller to existing system
.find column search returning