The -match
operator tests a regex, combine it with the magic variable $matches
to get your result
PS C:\> $x = "----start----Hello World----end----" PS C:\> $x -match "----start----(?<content>.*)----end----" True PS C:\> $matches['content'] Hello World
Whenever in doubt about regex-y things, check out this site: http://www.regular-expressions.info
Related Posts:
- What is lexicographical order?
- Regex not operator
- working of \n in python [duplicate]
- Regex not operator
- Extract substring in Bash
- Regex not operator
- What is the difference between \r\n, \r, and \n? [duplicate]
- string to string array conversion in java
- What is the difference between \r\n, \r, and \n? [duplicate]
- Regex how to match an optional character
- How to remove punctuation in python?
- How do I properly compare strings in C?
- How to remove .html from URL?
- What is the difference between a “line feed” and a “carriage return”?
- How to convert an int to string in C?
- Python: TypeError: cannot concatenate ‘str’ and ‘int’ objects
- Ignoring upper case and lower case in Java
- How to replace all double quotes to single quotes using jquery?
- Convert character to ASCII numeric value in java
- What does strcmp() exactly return in C?
- Generate random string/characters in JavaScript
- “[ ]” vs. “[[ ]]” in Bash shell
- How to trim whitespace from a Bash variable?
- How to get the filename without the extension from a path in Python?
- sprintf like functionality in Python
- C – The %x format specifier
- Lua string.format options
- n-grams in python, four, five, six grams?
- Alphabet range in Python
- How to trim whitespace from a Bash variable?
- What is the difference between ‘ and ” in JavaScript?
- Center text in fixed-width field with stream manipulators in C++
- C# – Illegal characters in path
- \n or \n in php echo not print [duplicate]
- Mips how to store user input string
- PadLeft function in T-SQL
- bash : Bad Substitution
- How to assign multiple lines string in Powershell Console
- LC-3 STR with R1 as offset
- Lua read beginning of a string
- How do I print my Java object without getting “SomeType@2f92e0f4”?
- How can I process each letter of text using Javascript?
- PHP to write Tab Characters inside a file?
- Haskell: Converting Int to String
- Passing string to a function in C – with or without pointers?
- Lua String replace
- Trim a string in C [duplicate]
- How to remove first character from C-string?
- Standard function to replace character or substring in a char array?
- Difference between char* and char** (in C)
- Extract filename and extension in Bash
- Meaning of #{ } in Ruby?
- Taking a new line using printf in java? Is %n correct?
- How to count instances of character in SQL Column
- Replacing instances of a character in a string
- How to check whether a string contains a substring in JavaScript?
- How to split a string in Java
- Pythonic way to create a long multi-line string
- Convert String to double in Java
- How do you reverse a string in-place in JavaScript?
- Splitting a string into separate variables
- String variable interpolation Java [duplicate]
- What is the correct way to check for string equality in JavaScript?
- How to parse this string in Java?
- How can I concatenate str and int objects?
- How do I create an array of strings in C?
- How to check if a string is a number?
- How to capitalize the first letter of a String in Java?
- Remove the first character of a string
- How can I splice a string?
- How do I create an array of strings in C?
- printf with std::string?
- What is Java String interning?
- Copy file remotely with PowerShell
- Reading a file line by line in Go
- Using Enum values as String literals
- How can I iterate through a string and also know the index (current position)?
- c++ parse int from string [duplicate]
- Remove quotes from String in Python
- Multi-line strings in PHP
- How to convert a string to lower case in Bash?
- How can I fix the error : “Unreachable Code Detected”
- How to compare individual characters in two strings in Python 3
- Simple way to repeat a string
- Uncaught Error: Call to undefined function mysql_escape_string()
- How to repeat a string with spaces?
- Split string in jquery
- Java String to SHA1
- error: switch quantity not an integer
- Reading a string from file c++
- Remove last character from C++ string
- How to convert UTF-8 byte[] to string
- Tokenizing strings in C
- Check if a string is a palindrome
- ‘setprecision’ is not a member of ‘std’
- Mutable strings in Python
- What is the difference between String and string in C#?
- Check if a JavaScript string is a URL
- Fastest way to put contents of Set
to a single String with words separated by a whitespace? - How to split a string in Haskell?