Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Get a known substring from a string

by Laurent_R (Canon)
on Sep 09, 2016 at 20:52 UTC ( [id://1171484]=note: print w/replies, xml ) Need Help??


in reply to Get a known substring from a string

I feel like I should make clear that I don't know where abouts in the string it will be, I just know that it is in there somewhere.
If you know the content of the sub-string literally in advance and know that it is there, then why would you want to look for it? Well, it you want to check that it is really there, or want to know where in the string it is, then maybe you want to try the index (or, possibly but less likely, the rindex) function. But I suspect that's not really what you want.

The problem, though, it that you did not state what you want. I would suspect you probably want to use a regex to find a sub-string that you don't know exactly in advance, but that matches certain criteria or pattern. If this is the case, please provide more information about what you know about that sub-string.

  • Comment on Re: Get a known substring from a string

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2024-04-25 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found