Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^5: regex search for words with one digit

by AnomalousMonk (Archbishop)
on Sep 23, 2020 at 04:47 UTC ( [id://11122108]=note: print w/replies, xml ) Need Help??


in reply to Re^4: regex search for words with one digit
in thread regex search for words with one digit

Ah — I completely missed this point! Maybe a bit of occasional cargo-culting isn't entirely bad. :)

I still think I would use (?<! \S) (?! \S) as boundary assertions instead of \b though, to properly handle "words" like 'a1-b1'. Anon gives no hint that such things may appear in the data, but an abundance of caution inclines me this way. More reflex defensiveness I guess.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^6: regex search for words with one digit
by hippo (Bishop) on Sep 23, 2020 at 08:14 UTC
    Anon gives no hint that such things may appear in the data

    Furthermore, Anon gives no hint whether they should be treated as one word or two if they did. It's great to have both tools in the box but blindly applying one or other in the absence of a relevant spec becomes a guessing game.


    🦛

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122108]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-20 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found