- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- regular expressions gurus
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 09:46 AM
тАО09-10-2010 09:46 AM
This is the entire string.
Solved! Go to Solution.
- Tags:
- regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 10:10 AM
тАО09-10-2010 10:10 AM
Re: regular expressions gurus
If all you want is the string in double quotes following the string "value=" you might do:
# X='
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 10:53 AM
тАО09-10-2010 10:53 AM
Re: regular expressions gurus
can you show me how this would be incorporated into this line? If at all possible.
@nextline=split( ,$nline);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 11:19 AM
тАО09-10-2010 11:19 AM
SolutionSo it seems that $nline holds what you want to match and extract from. Hence:
...
$nline =
$nline =~ m{value="([^"]+)"} and print $1,"\n";
...will print the word "test" in your example.
We want to match the contents of $nline. We are looking for the string 'value="..."' and we want to extract whatever lies between an opening double quote and a closing one. If we can match this, the $1 variable holds the match and that's what we print.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 11:50 AM
тАО09-10-2010 11:50 AM
Re: regular expressions gurus
that's the answer I was looking for ..
Thank you so much!!
I'm still reading my camel book on the section of Pattern-Matching Operators though.
Regex's are a beast! But I'm still learning :-)
thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2010 11:51 AM
тАО09-10-2010 11:51 AM