- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- sed extended regexp and subexpressions
Operating System - Linux
1753709
Members
4883
Online
108799
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
02-01-2005 09:43 AM
02-01-2005 09:43 AM
sed extended regexp and subexpressions
Has anybody here ever managed to use sed with extended regexp's turned on (-r|--regexp-extended) and been able to use subexpressions \( \) and backreferences \1, \2, \n in substitution commands?
Because extended regexp's use parentheses for grouping expressions, in order to match a literal paren in the pattern space, you have to escape the paren, but esccaped parens are what subexpressions in substitution commands use to denote patterns which may be referenced by backreferences. So, how do you denote subexpressions for backreferences with extended regexp turned on?
--
Cathy344
Because extended regexp's use parentheses for grouping expressions, in order to match a literal paren in the pattern space, you have to escape the paren, but esccaped parens are what subexpressions in substitution commands use to denote patterns which may be referenced by backreferences. So, how do you denote subexpressions for backreferences with extended regexp turned on?
--
Cathy344
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2005 10:21 AM
02-02-2005 10:21 AM
Re: sed extended regexp and subexpressions
The last paragraph in the DESCRIPTION section of "man 7 regex" states that the \( \) and
\1 \2 subexpression notations are specific
to the 'basic' regular expressions. There
is no equivalent for extended regular
expressions.
\1 \2 subexpression notations are specific
to the 'basic' regular expressions. There
is no equivalent for extended regular
expressions.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP