If you change the game, you change the win. Tell us all of the contexts in which you hope to find your desired string.
JavaFan's regex worked for your first example because you showed a short, unambiguous introduction to your goal string. /\S/ matches on non-whitespace; there's no whitespace in your first example between /has address / and your goal string. Note that the single space following the last 's' is included in the regex.
Matching on /A/ doesn't work in your second example because the introduction to your goal string is not /A/; it's /A\s+/. This would not be real smart; it's not likely to be unique.
Formulate your problem clearly. Prepare a short list of all the various forms of input data you expect to see; and for each form, desired output. Then it is easy, even possible, to construct a solution.
I'm not the guy you kill, I'm the guy you buy. —Michael Clayton
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||