AlliDeacon AlliDeacon - 1 year ago 55
Perl Question

PERL Regex help matching a string in a field

I currently have a field that looks like this.

item description is blah ablha blabh albhalbh #thisisitemnumber x/skid)

I am trying to extract the
portion. I currently have this:


But using that I get everything after the "#" even the whitespace.
Any help is appreciated!

Thanks :)

Answer Source

You are matching any char . any number of times * until non-space \S.

You want non-space one or more times:


This presumes that there should be something after #, thus the +

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download